Examples of FTPFile


Examples of de.kout.wlFxp.ftp.FtpFile

    JPanel p = new JPanel();
    GridBagLayout gbl = new GridBagLayout();
    GridBagConstraints gbc;
    p.setLayout(gbl);

    FtpFile from = t.getSource();
    FtpFile to = t.getDest();
    String text = "overwrite \"" + to.getName() + "\" size: " + to.getSize()
         + " with: \"" + from.getName() + "\" size: " + from.getSize() + " ?";
    rest = to.getSize();

    label = new JLabel(text);
    gbc = makegbc(0, 0, 3, 1);
    gbl.setConstraints(label, gbc);
    p.add(label);

    if (to.getSize() < from.getSize()) {
      resume = new JButton("Resume");
      resume.addActionListener(this);
      gbc = makegbc(0, 1, 1, 1);
      gbl.setConstraints(resume, gbc);
      p.add(resume);
View Full Code Here

Examples of de.kout.wlFxp.ftp.FtpFile

      return "..";
    }
    if (files.size() >= index && index > 0) {
      return files.elementAt(index - 1);
    } else {
      return new FtpFile();
    }
  }
View Full Code Here

Examples of de.kout.wlFxp.ftp.FtpFile

  public Object getValueAt(int rowIndex, int columnIndex) {
    if (rowIndex == 0) {
      if (columnIndex > 0) {
        return "";
      }
      return new FtpFile("..");
    }
    if (files.size() >= rowIndex && rowIndex > 0) {
      if (columnIndex == 0) {
        return (FtpFile) files.elementAt(rowIndex - 1);
      } else if (columnIndex == 1) {
        return String.valueOf(((FtpFile) files.elementAt(rowIndex - 1)).hSize);
      } else if (columnIndex == 2) {
        return ((FtpFile) files.elementAt(rowIndex - 1)).getMode();
      } else if (columnIndex == 3) {
        return ((FtpFile) files.elementAt(rowIndex - 1)).getDate();
      }
    }
    return new FtpFile();
  }
View Full Code Here

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

Examples of org.apache.commons.net.ftp.FTPFile

        FTPFile[] files = client.listFiles(TEST_FILE1.getName());

        assertEquals(1, files.length);

        FTPFile file = getFile(files, TEST_FILE1.getName());
        assertEquals(TEST_FILE1.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertTrue(file.isFile());
        assertFalse(file.isDirectory());
       
        Calendar expectedTimestamp = Calendar.getInstance();
        expectedTimestamp.setTimeInMillis(TEST_FILE1.lastModified());
        // server does not supply seconds and milliseconds
        expectedTimestamp.clear(Calendar.SECOND);
        expectedTimestamp.clear(Calendar.MILLISECOND);
       
        assertEquals(expectedTimestamp, file.getTimestamp());
    }
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFile

        FTPFile[] files = client.listFiles();

        assertEquals(1, files.length);

        FTPFile file = getFile(files, TEST_DIR1.getName());
        assertEquals(TEST_DIR1.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertFalse(file.isFile());
        assertTrue(file.isDirectory());
    }
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFile

        TestUtil.writeDataToFile(TEST_FILE1, testData);

        FTPFile[] files = client.listFiles();

        assertEquals(4, files.length);
        FTPFile file = getFile(files, TEST_FILE1.getName());
        assertEquals(TEST_FILE1.getName(), file.getName());
        assertEquals(testData.length, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertTrue(file.isFile());
        assertFalse(file.isDirectory());

        file = getFile(files, TEST_FILE2.getName());
        assertEquals(TEST_FILE2.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertTrue(file.isFile());
        assertFalse(file.isDirectory());

        file = getFile(files, TEST_DIR1.getName());
        assertEquals(TEST_DIR1.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertFalse(file.isFile());
        assertTrue(file.isDirectory());

        file = getFile(files, TEST_DIR2.getName());
        assertEquals(TEST_DIR2.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertFalse(file.isFile());
        assertTrue(file.isDirectory());
    }
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFile

    }

   
    private FTPFile getFile(FTPFile[] files, String name) {
        for (int i = 0; i < files.length; i++) {
            FTPFile file = files[i];

            if (name.equals(file.getName())) {
                return file;
            }
        }

        return null;
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFile

        FTPFile[] files = client.listFiles(TEST_DIR1.getName());

        assertEquals(2, files.length);

        FTPFile file = getFile(files, TEST_FILE_IN_DIR1.getName());
        assertEquals(TEST_FILE_IN_DIR1.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertTrue(file.isFile());
        assertFalse(file.isDirectory());

        file = getFile(files, TEST_DIR_IN_DIR1.getName());
        assertEquals(TEST_DIR_IN_DIR1.getName(), file.getName());
        assertEquals(0, file.getSize());
        assertEquals("group", file.getGroup());
        assertEquals("user", file.getUser());
        assertFalse(file.isFile());
        assertTrue(file.isDirectory());

    }
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFile

        // List the children of this file
        doGetChildren();

        // Look for the requested child
        FTPFile ftpFile = (FTPFile) children.get(name);
        return ftpFile;
    }
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.