commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinicius Carvalho <vinicius.carva...@sambatech.com.br>
Subject FTPClient missing 15bytes from files
Date Tue, 02 Mar 2010 12:04:10 GMT
Hello there! I have an FTP Server based on apache mina FTPServer. And now we
are automating some tests. I'm using FTPClient to send the files, to my
local FTPServer, but somehow, all files are 15bytes short. No matter what
type (we are sending binary files, but any extension, end with the same
problem)

My FTPServer is 1.0.3 and the commons-net is 2.0

Here's a snippet:

FTPClient client = new FTPClient();

        client.connect("localhost", 2121);
        client.login("acme@ftp.com", "userftp");
        client.enterLocalPassiveMode();
        client.setFileTransferMode(FTP.BINARY_FILE_TYPE);
        client.setFileTransferMode(FTP.BLOCK_TRANSFER_MODE);

        FTPFile[] files = client.listFiles();
        for(FTPFile f : files){
            if(f.isDirectory()){
                client.changeWorkingDirectory(f.getName());
            }
        }
        File zipFile = getZipFile();
        client.setBufferSize((int) zipFile.getAbsoluteFile().length());
        FileInputStream fin = new FileInputStream(zipFile);
        client.storeFile(remoteName, fin);
        fin.close();
        client.logout();
        client.disconnect();

Any ideas?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message