Inheritance: SshTransport, IWalkTransport
Beispiel #1
0
            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);
                }
            }
Beispiel #2
0
 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);
     }
 }
Beispiel #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);
        }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
            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);
                }
            }