示例#1
0
		/// <summary>
		/// Set SSH session factory instead of the default one for this instance of
		/// the transport.
		/// </summary>
		/// <remarks>
		/// Set SSH session factory instead of the default one for this instance of
		/// the transport.
		/// </remarks>
		/// <param name="factory">a factory to set, must not be null</param>
		/// <exception cref="System.InvalidOperationException">if session has been already created.
		/// 	</exception>
		public virtual void SetSshSessionFactory(SshSessionFactory factory)
		{
			if (factory == null)
			{
				throw new ArgumentNullException(JGitText.Get().theFactoryMustNotBeNull);
			}
			if (sock != null)
			{
				throw new InvalidOperationException(JGitText.Get().anSSHSessionHasBeenAlreadyCreated
					);
			}
			sch = factory;
		}
示例#2
0
 /// <summary>Change the JVM-wide factory to a different implementation.</summary>
 /// <remarks>Change the JVM-wide factory to a different implementation.</remarks>
 /// <param name="newFactory">
 /// factory for future sessions to be created through. If null the
 /// default factory will be restored.s
 /// </param>
 public static void SetInstance(SshSessionFactory newFactory)
 {
     if (newFactory != null)
     {
         INSTANCE = newFactory;
     }
     else
     {
         INSTANCE = new DefaultSshSessionFactory();
     }
 }
示例#3
0
		/// <summary>Create a new transport instance.</summary>
		/// <remarks>Create a new transport instance.</remarks>
		/// <param name="local">
		/// the repository this instance will fetch into, or push out of.
		/// This must be the repository passed to
		/// <see cref="Transport.Open(NGit.Repository, URIish)">Transport.Open(NGit.Repository, URIish)
		/// 	</see>
		/// .
		/// </param>
		/// <param name="uri">
		/// the URI used to access the remote repository. This must be the
		/// URI passed to
		/// <see cref="Transport.Open(NGit.Repository, URIish)">Transport.Open(NGit.Repository, URIish)
		/// 	</see>
		/// .
		/// </param>
		protected internal SshTransport(Repository local, URIish uri) : base(local, uri)
		{
			sch = SshSessionFactory.GetInstance();
		}
示例#4
0
 /// <summary>Create a new transport instance.</summary>
 /// <remarks>Create a new transport instance.</remarks>
 /// <param name="local">
 /// the repository this instance will fetch into, or push out of.
 /// This must be the repository passed to
 /// <see cref="Transport.Open(NGit.Repository, URIish)">Transport.Open(NGit.Repository, URIish)
 ///     </see>
 /// .
 /// </param>
 /// <param name="uri">
 /// the URI used to access the remote repository. This must be the
 /// URI passed to
 /// <see cref="Transport.Open(NGit.Repository, URIish)">Transport.Open(NGit.Repository, URIish)
 ///     </see>
 /// .
 /// </param>
 protected internal SshTransport(Repository local, URIish uri) : base(local, uri)
 {
     sch = SshSessionFactory.GetInstance();
 }