Package com.trilead.ssh2.transport

Examples of com.trilead.ssh2.transport.KexManager


    if (!recursive) return nList("");
    Vector rvVector = new Vector();
    if (pathname.length()==0) pathname=".";
    Vector files = sftpClient.ls(pathname);
    for(int i=0; i<files.size();i++){
      SFTPv3DirectoryEntry entry = (SFTPv3DirectoryEntry) files.get(i);
      if (!entry.attributes.isDirectory()){
        rvVector.add(entry.filename);
      } else if (!entry.filename.equals(".") && !entry.filename.equals("..")){       
        nList(rvVector, currentDirectory, entry.filename);
      }
View Full Code Here


    String slash="";
    if (!workingDirectory.endsWith("/")) slash="/";
    String fullPathname = currentDirectory + slash + pathname;
    Vector files = sftpClient.ls(fullPathname);
    for(int i=0; i<files.size();i++){
      SFTPv3DirectoryEntry entry = (SFTPv3DirectoryEntry) files.get(i);
      if (!entry.attributes.isDirectory()){
        rvVector.add(pathname+"/"+entry.filename);
      } else if (!entry.filename.equals(".") && !entry.filename.equals("..")){
        nList(rvVector, currentDirectory, pathname+"/"+entry.filename);
      }
View Full Code Here

      }
      Vector files = Client().ls(pathname);
      String[] rvFiles = new String[files.size()];

      for (int i = 0; i < files.size(); i++) {
        SFTPv3DirectoryEntry entry = (SFTPv3DirectoryEntry) files.get(i);
        rvFiles[i] = entry.filename;
      }
      reply = "ls OK";
      return rvFiles;
    }
View Full Code Here

  public void addPath(String path) {
    this.path += path;
  }

  public boolean getAllowsChildren() {
    SFTPv3DirectoryEntry node = (SFTPv3DirectoryEntry) getUserObject();
    if (node != null)
      return node.attributes.isDirectory();
    return false;
  }
View Full Code Here

  public String getPathString() {
    return path;
  }

  public String toString() {
    SFTPv3DirectoryEntry node = (SFTPv3DirectoryEntry) getUserObject();
    if (node != null)
      return node.filename;
    else
      return remoteProject.getName();
  }
View Full Code Here

  }

  public File transferCommandScript(File commandFile, boolean isWindows) throws Exception {
    try {
      SFTPv3Client sftpClient = new SFTPv3Client(this.getSshConnection());
      SFTPv3FileAttributes attr = new SFTPv3FileAttributes();
      attr.permissions = new Integer(0700);

      boolean exists = true;
      // check if File already exists
      while (exists) {
        try {
          SFTPv3FileAttributes attribs = sftpClient.stat(commandFile.getName());
        }
        catch (SFTPException e) {
          getLogger().debug9("Error code when checking file existence: " + e.getServerErrorCode());
          exists = false;
        }
View Full Code Here

   * @throws Exception
   */
  protected boolean sshFileExists(SFTPv3Client psftpClient, String filename) {

    try {
      SFTPv3FileAttributes attributes = psftpClient.stat(filename);

      if (attributes != null) {
        return (attributes.isRegularFile() || attributes.isDirectory());
      }
      else {
        return false;
      }
    }
View Full Code Here

   * @throws Exception
   */
  protected int sshFilePermissions(SFTPv3Client psftpClient, String filename) {

    try {
      SFTPv3FileAttributes attributes = psftpClient.stat(filename);

      if (attributes != null) {
        return attributes.permissions.intValue();
      }
      else {
View Full Code Here

  public SFTPv3FileHandle getFileHandle(final String pstrFileName, final Integer pintPermissions) throws Exception {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setFilePermissions";

    SFTPv3FileAttributes attr = new SFTPv3FileAttributes();
    attr.permissions = pintPermissions;
    SFTPv3FileHandle fileHandle = this.FtpClient().createFileTruncate(pstrFileName, attr);
    return fileHandle;
  } // private void setFilePermissions
View Full Code Here

  public void setFilePermissions(final String pstrFileName, final Integer pintPermissions) throws Exception {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setFilePermissions";

    SFTPv3FileAttributes attr = new SFTPv3FileAttributes();
    attr.permissions = pintPermissions;
    @SuppressWarnings("unused")
    SFTPv3FileHandle fileHandle = this.FtpClient().createFileTruncate(pstrFileName, attr);
  } // private void setFilePermissions
View Full Code Here

TOP

Related Classes of com.trilead.ssh2.transport.KexManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.