Examples of SFTPv3FileAttributes


Examples of com.trilead.ssh2.SFTPv3FileAttributes

     * @throws Exception
     */
    public int sshFilePermissions(SFTPv3Client sftpClient, String filename) {
       
        try {
            SFTPv3FileAttributes attributes = sftpClient.stat(filename);
           
            if (attributes != null) {
                return attributes.permissions.intValue();
            } else {
                return 0;
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

     * @throws Exception
     */
    private boolean fileExists( String filename) {
       
        try {
            SFTPv3FileAttributes attributes = sftpClient.stat(filename);
           
            if (attributes != null) {
                return (attributes.isRegularFile() || attributes.isDirectory());
            } else {
                return false;
            }
           
        } catch (Exception e) {
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

  }

  private boolean fileExists(String filename) {

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

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

Examples of com.trilead.ssh2.SFTPv3FileAttributes

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

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

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

View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

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

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

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

Examples of com.trilead.ssh2.SFTPv3FileAttributes

    /**
     * Makes sure that the directory exists, by creating it if necessary.
     */
    public void mkdirs(String path, int posixPermission) throws IOException {
        SFTPv3FileAttributes atts = _stat(path);
        if (atts!=null && atts.isDirectory())
            return;

        int idx = path.lastIndexOf("/");
        if (idx>0)
            mkdirs(path.substring(0,idx), posixPermission);
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

            }
        };
    }

    public void chmod(String path, int permissions) throws IOException {
        SFTPv3FileAttributes atts = new SFTPv3FileAttributes();
        atts.permissions = permissions;
        setstat(path, atts);
    }
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

            // getting size of the file on DAS
            if (instanceLogFile.exists())
                instanceLogFileSize = instanceLogFile.length();

            SFTPv3FileAttributes sftPv3FileAttributes = sftpClient._stat(loggingFile);

            // getting size of the file on instance machine
            long fileSizeOnNode = sftPv3FileAttributes.size;

            // if differ both size then downloading
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

        @Override
        void setLastModified(final String path, final long when) throws IOException {
            /*
             * Times over ssh are expressed as seconds since 01 Jan 1970.
             */
            final SFTPv3FileAttributes attrs = ftpClient.stat(path);
            attrs.mtime = secondsSince_01_Jan_1970(when);
            ftpClient.setstat(path, attrs);
        }
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3FileAttributes

      throws IOException {
    SFTPv3DirectoryEntry entry = new SFTPv3DirectoryEntry();
    SFTPv3Client sftpConn = null;
    try {
      sftpConn = new SFTPv3Client(conn);
      SFTPv3FileAttributes attribute = sftpConn.lstat(path);
      entry.attributes = attribute;
      entry.filename = path.substring(path.lastIndexOf("/") + 1);
    } catch (IOException e) {
      throw e;
    } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.