Inheritance: SshTransport, IWalkTransport
コード例 #1
0
ファイル: TransportSftp.cs プロジェクト: kkl713/GitSharp
            public SftpObjectDatabase(string path, TransportSftp instance)
            {
                this._instance = instance;

                if (path.StartsWith("/~"))
                {
                    path = path.Substring(1);
                }

                if (path.StartsWith("~/"))
                {
                    path = path.Substring(2);
                }

                try
                {
                    _ftp = instance.NewSftp();
                    _ftp.cd(path);
                    _ftp.cd("objects");
                    _objectsPath = _ftp.pwd();
                }
                catch (TransportException)
                {
                    close();
                    throw;
                }
                catch (SftpException je)
                {
                    throw new TransportException("Can't enter " + path + "/objects: " + je.message, je);
                }
            }
コード例 #2
0
ファイル: TransportSftp.cs プロジェクト: kkl713/GitSharp
 private SftpObjectDatabase(SftpObjectDatabase parent, string p, TransportSftp instance)
 {
     this._instance = instance;
     try
     {
         _ftp = instance.NewSftp();
         _ftp.cd(parent._objectsPath);
         _ftp.cd(p);
         _objectsPath = _ftp.pwd();
     }
     catch (TransportException)
     {
         close();
         throw;
     }
     catch (SftpException je)
     {
         throw new TransportException("Can't enter " + p + " from " + parent._objectsPath + ": " + je.message, je);
     }
 }
コード例 #3
0
        /// <summary>
        /// Open a new transport instance to connect two repositories.
        /// </summary>
        /// <param name="local">existing local repository.</param>
        /// <param name="remote">location of the remote repository.</param>
        /// <returns>the new transport instance. Never null.</returns>
        public static Transport open(Repository local, URIish remote)
        {
            if (TransportGitSsh.canHandle(remote))
            {
                return(new TransportGitSsh(local, remote));
            }

            if (TransportHttp.canHandle(remote))
            {
                return(new TransportHttp(local, remote));
            }

            if (TransportSftp.canHandle(remote))
            {
                return(new TransportSftp(local, remote));
            }

            if (TransportGitAnon.canHandle(remote))
            {
                return(new TransportGitAnon(local, remote));
            }

            if (TransportAmazonS3.canHandle(remote))
            {
                return(new TransportAmazonS3(local, remote));
            }

            if (TransportBundleFile.canHandle(remote))
            {
                return(new TransportBundleFile(local, remote));
            }

            if (TransportLocal.canHandle(remote))
            {
                return(new TransportLocal(local, remote));
            }

            throw new NotSupportedException("URI not supported: " + remote);
        }
コード例 #4
0
ファイル: TransportSftp.cs プロジェクト: stschake/GitSharp
 private SftpObjectDatabase(SftpObjectDatabase parent, string p, TransportSftp instance)
 {
     this._instance = instance;
     try
     {
         _ftp = instance.NewSftp();
         _ftp.cd(parent._objectsPath);
         _ftp.cd(p);
         _objectsPath = _ftp.pwd();
     }
     catch (TransportException)
     {
         CleanUp();
         throw;
     }
     catch (SftpException je)
     {
         throw new TransportException("Can't enter " + p + " from " + parent._objectsPath + ": " + je.message, je);
     }
 }
コード例 #5
0
ファイル: TransportSftp.cs プロジェクト: stschake/GitSharp
            public SftpObjectDatabase(string path, TransportSftp instance)
            {
                this._instance = instance;

                if (path.StartsWith("/~"))
                {
                    path = path.Substring(1);
                }

                if (path.StartsWith("~/"))
                {
                    path = path.Substring(2);
                }

                try
                {
                    _ftp = instance.NewSftp();
                    _ftp.cd(path);
                    _ftp.cd("objects");
                    _objectsPath = _ftp.pwd();
                }
                catch (TransportException)
                {
                    CleanUp();
                    throw;
                }
                catch (SftpException je)
                {
                    throw new TransportException("Can't enter " + path + "/objects: " + je.message, je);
                }
            }