Alright I'm trying to copy files from directoryA to directoryB but I can't seem to get this working, any tips!
Code:
public void copyFiles()
{
try
{
System.out.println("Working");
System.out.println(directoryA);
FileChannel in = new FileInputStream(directoryA).getChannel();
FileChannel out = new FileOutputStream(directoryB).getChannel();
in.transferTo(0, in.size(), out);
}
catch(FileNotFoundException ex)
{
System.out.println("Filenotfound");
}
catch(NullPointerException ex)
{
System.out.println("NullPointerException");
}
catch(IOException ex)
{
System.out.println("IOException");
}
}
Comment