Examples of SftpFile


Examples of com.sshtools.j2ssh.sftp.SftpFile

    }

    public long getTransferSize() {
        Object obj;
        long size = 0;
        SftpFile sftpfile;
        File file;

        for (Iterator i = newFiles.iterator(); i.hasNext();) {
            obj = i.next();

            if (obj instanceof File) {
                file = (File) obj;

                if (file.isFile()) {
                    size += file.length();
                }
            } else if (obj instanceof SftpFile) {
                sftpfile = (SftpFile) obj;

                if (sftpfile.isFile()) {
                    size += sftpfile.getAttributes().getSize().longValue();
                }
            }
        }

        for (Iterator i = updatedFiles.iterator(); i.hasNext();) {
            obj = i.next();

            if (obj instanceof File) {
                file = (File) obj;

                if (file.isFile()) {
                    size += file.length();
                }
            } else if (obj instanceof SftpFile) {
                sftpfile = (SftpFile) obj;

                if (sftpfile.isFile()) {
                    size += sftpfile.getAttributes().getSize().longValue();
                }
            }
        }

        // Add a value for deleted files??
View Full Code Here

Examples of com.sshtools.j2ssh.sftp.SftpFile

                    SftpFile[] files = new SftpFile[count];

                    for (int i = 0; i < files.length; i++) {
                        File f = children[pos + i];
                        String absolutePath = dir.realPath + "/" + f.getName();
                        SftpFile sftpfile = new SftpFile(f.getName(),
                                getFileAttributes(absolutePath));
                        files[i] = sftpfile;
                    }

                    dir.readpos = pos + files.length;
View Full Code Here

Examples of com.sshtools.j2ssh.sftp.SftpFile

       
        //  Loop through all the returned values
        Iterator i = contents.iterator();
       
        while(i.hasNext()){
          SftpFile entry = (SftpFile)i.next();
         
          //  Ignores anything with a . or .. in it
          if(entry.getFilename().endsWith(".")) continue;

          //  Get the attributes for this directory item
          FileAttributes attrib = entry.getAttributes();
         
          //  Is it a directory or file? add it to the appropriate array
          if(attrib.isDirectory() == true && m_details.getRecurse() == true){
            folders.add(directory+entry.getFilename()+"/");
          }else{
            files.add(directory+entry.getFilename());
          }
        }
       
        return true;
      }catch(IOException e){
View Full Code Here

Examples of com.sshtools.j2ssh.sftp.SftpFile

    }

    public long getTransferSize() {
        Object obj;
        long size = 0;
        SftpFile sftpfile;
        File file;

        for (Iterator i = newFiles.iterator(); i.hasNext();) {
            obj = i.next();

            if (obj instanceof File) {
                file = (File) obj;

                if (file.isFile()) {
                    size += file.length();
                }
            } else if (obj instanceof SftpFile) {
                sftpfile = (SftpFile) obj;

                if (sftpfile.isFile()) {
                    size += sftpfile.getAttributes().getSize().longValue();
                }
            }
        }

        for (Iterator i = updatedFiles.iterator(); i.hasNext();) {
            obj = i.next();

            if (obj instanceof File) {
                file = (File) obj;

                if (file.isFile()) {
                    size += file.length();
                }
            } else if (obj instanceof SftpFile) {
                sftpfile = (SftpFile) obj;

                if (sftpfile.isFile()) {
                    size += sftpfile.getAttributes().getSize().longValue();
                }
            }
        }

        // Add a value for deleted files??
View Full Code Here

Examples of com.sshtools.j2ssh.sftp.SftpFile

       
        //  Loop through all the returned values
        Iterator i = contents.iterator();
       
        while(i.hasNext()){
          SftpFile entry = (SftpFile)i.next();
         
          //  Ignores anything with a . or .. in it
          if(entry.getFilename().endsWith(".")) continue;
          //m_output.println("[ryan]entry = "+entry+", entry filename = "+entry.getFilename());
          //  Get the attributes for this directory item
          FileAttributes attrib = entry.getAttributes();
          //m_output.println("[ryan]attrib = "+attrib+", attrib string = "+attrib.toString());
         
          //  Is it a directory or file? add it to the appropriate array
          if(attrib.isDirectory() == true && m_details.getRecurse() == true){
            folders.add(directory+entry.getFilename()+"/");
          }else{
            files.add(directory+entry.getFilename());
          }
        }
      }catch(IOException e){
        //  There was an exception scanning this directory
        //  TODO; This could possibly mean that the remote directory doesnt exist
View Full Code Here

Examples of com.sshtools.j2ssh.sftp.SftpFile

                    SftpFile[] files = new SftpFile[count];

                    for (int i = 0; i < files.length; i++) {
                        File f = children[pos + i];
                        String absolutePath = dir.realPath + "/" + f.getName();
                        SftpFile sftpfile = new SftpFile(f.getName(),
                                getFileAttributes(absolutePath));
                        files[i] = sftpfile;
                    }

                    dir.readpos = pos + files.length;
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.