Package it.sauronsoftware.ftp4j

Examples of it.sauronsoftware.ftp4j.FTPFile


  private static final DateFormat MLSD_DATE_FORMAT_2 = new SimpleDateFormat("yyyyMMddhhmmss Z");

  public FTPFile[] parse(String[] lines) throws FTPListParseException {
    ArrayList list = new ArrayList();
    for (int i = 0; i < lines.length; i++) {
      FTPFile file = parseLine(lines[i]);
      if (file != null) {
        list.add(file);
      }
    }
    int size = list.size();
View Full Code Here


      if (size < 0) {
        size = 0;
      }
    }
    // Done!
    FTPFile ret = new FTPFile();
    ret.setType(type);
    ret.setModifiedDate(modifiedDate);
    ret.setSize(size);
    ret.setName(name);
    return ret;
  }
View Full Code Here

        String yearString = m.group(5);
        String hourString = m.group(6);
        String minuteString = m.group(7);
        String nameString = m.group(8);
        // Parse the data.
        ret[i] = new FTPFile();
        if (typeString.equals("-")) {
          ret[i].setType(FTPFile.TYPE_FILE);
        } else if (typeString.equals("d")) {
          ret[i].setType(FTPFile.TYPE_DIRECTORY);
        } else {
View Full Code Here

      }
      // Create the related FTPFile object.
      if (ret == null) {
        ret = new FTPFile[size];
      }
      ret[i] = new FTPFile();
      ret[i].setName(name);
      ret[i].setModifiedDate(md);
      ret[i].setSize(fileSize);
      ret[i].setType(dir ? FTPFile.TYPE_DIRECTORY : FTPFile.TYPE_FILE);
    }
View Full Code Here

    int currentYear = now.get(Calendar.YEAR);
    FTPFile[] ret = new FTPFile[size];
    for (int i = 0; i < size; i++) {
      Matcher m = PATTERN.matcher(lines[i]);
      if (m.matches()) {
        ret[i] = new FTPFile();
        // Retrieve the data.
        String typeString = m.group(1);
        String sizeString = m.group(2);
        String monthString = m.group(3);
        String dayString = m.group(4);
View Full Code Here

        String hour = m.group(4);
        String minute = m.group(5);
        String ampm = m.group(6);
        String dirOrSize = m.group(7);
        String name = m.group(8);
        ret[i] = new FTPFile();
        ret[i].setName(name);
        if (dirOrSize.equalsIgnoreCase("<DIR>")) {
          ret[i].setType(FTPFile.TYPE_DIRECTORY);
          ret[i].setSize(0);
        } else {
View Full Code Here

TOP

Related Classes of it.sauronsoftware.ftp4j.FTPFile

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.