I am doing an FTP Get in Java with FTP Client which if I run on windows works fine but when I run the same on a linux box it get me the file with some modifications.
I have a test.tar.gz file (bunch of text files) which is of size 2872578 but it shows up as 2872541 when I run my java program on linux. Anyone faced a similar problem?
//write files to local FS
OutputStream output = null;
for(int i = 0; i < files.length; i++)
{
if(files[i].getName().compareTo(file) == 0 || files[i].getName().compareTo("*") ==0)
if(!files[i].getName().startsWith(".") && files[i].getType() != 1)
{
try {
if(targetdir != null)
output = new FileOutputStream(new File(targetdir + files[i].getName()));
else
output = new FileOutputStream(new File(files[i].getName()));
System.out.println("Creating: " + files[i].getName());
client.retrieveFile(files[i].getName(), output);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}