So, I'm writing FTP server-client but the code can't read any file. I mean. I have a file at Downloads. Let's say /Downloads/supplement2.pdf but I get a FileNotFoundException. Even though the file is there and I can see it. I even made a test folder and set it's privilages to 777. Still, nothing.
Is there a way to set what netbeans does as superuser or something? I mean. I just want to copy and paste something but can't. Here's the copy and paste code. If you see anything wrong with it please share.
public static void copyFile(File in, File out)
throws IOException
{
FileChannel inChannel = new
FileInputStream(in).getChannel();
FileChannel outChannel = new
FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(),
outChannel);
}
catch (IOException e) {
throw e;
}
finally {
if (inChannel != null) inChannel.close();
if (outChannel != null) outChannel.close();
}
}
Thanks