cd() public method

public cd ( String path ) : void
path String
return void
Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
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);
                }
            }