Examples of SftpATTRS


Examples of com.jcraft.jsch.SftpATTRS

            if (r != null) {
                for (Iterator iter = r.iterator(); iter.hasNext();) {
                    Object obj = iter.next();
                    if (obj instanceof LsEntry) {
                        LsEntry entry = (LsEntry) obj;
                        SftpATTRS attrs = entry.getAttrs();
                        return new BasicResource(path, true, attrs.getSize(),
                                attrs.getMTime() * 1000, false);
                    }
                }
            }
        } catch (Exception e) {
            Message.debug("reolving resource error: " + e.getMessage());
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

        }
    }

    private void mkdirs(String directory, ChannelSftp c) throws IOException, SftpException {
        try {
            SftpATTRS att = c.stat(directory);
            if (att != null) {
                if (att.isDir()) {
                    return;
                }
            }
        } catch (SftpException ex) {
            if (directory.indexOf('/') != -1) {
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

     */
    public long getLastModifiedTime(String filename) throws IOException
    {
        try
        {
            SftpATTRS attrs = channelSftp.stat("./" + filename);
            return attrs.getMTime() * 1000L;
        }
        catch (SftpException e)
        {
            throw new IOException(e.getMessage());
        }
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

            if (r != null) {
                for (Iterator iter = r.iterator(); iter.hasNext();) {
                    Object obj = iter.next();
                    if (obj instanceof LsEntry) {
                        LsEntry entry = (LsEntry) obj;
                        SftpATTRS attrs = entry.getAttrs();
                        return new BasicResource(path, true, attrs.getSize(),
                                attrs.getMTime() * 1000, false);
                    }
                }
            }
        } catch (Exception e) {
            Message.debug("reolving resource error: " + e.getMessage());
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

        }
    }

    private void mkdirs(String directory, ChannelSftp c) throws IOException, SftpException {
        try {
            SftpATTRS att = c.stat(directory);
            if (att != null) {
                if (att.isDir()) {
                    return;
                }
            }
        } catch (SftpException ex) {
            if (directory.indexOf('/') != -1) {
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

      if (r != null) {
        for (Iterator iter = r.iterator(); iter.hasNext();) {
          Object obj=iter.next();
                  if(obj instanceof LsEntry){
                    LsEntry entry = (LsEntry) obj;
                    SftpATTRS attrs = entry.getAttrs();
                    return new BasicResource(path, true, attrs.getSize(), attrs.getMTime() * 1000, false);
                  }
        }
      }
    } catch (Exception e) {
            Message.debug("reolving resource error: "+e.getMessage());
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

    }
  }

  private void mkdirs(String directory, ChannelSftp c) throws IOException, SftpException {
      try {
        SftpATTRS att = c.stat(directory);
        if (att != null) {
          if (att.isDir()) {
            return;
          }
        }
      } catch (SftpException ex) {
          if (directory.indexOf('/') != -1) {
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

            }

            @Override
            public SftpStat stat(File file) throws IOException {
                try {
                    SftpATTRS attrs = channel.stat(file.getPath());
                    return new JschSftpStat(attrs);
                } catch (SftpException e) {
                    if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
                        return null;
                    }
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

                    throw new IOException("Error getting file stat: " + file, e);
                }
            }

            public SftpATTRS lstat(File file) throws IOException {
                SftpATTRS lstat = null;
                try {
                    lstat = channel.lstat(file.getAbsolutePath());
                } catch (SftpException e) {
                    if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
                        throw new FileNotFoundException();
View Full Code Here

Examples of com.jcraft.jsch.SftpATTRS

    }

    public Resource getResource(ResourceURI uri) {
        try {
            ChannelSftp channel = getOrCreateChannel(uri);
            SftpATTRS stat;

            try {
                stat = channel.stat(uri.getPath());
            } catch (SftpException e) {
                throw new ResourceNotFoundException(e);
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.