I am currently using Mac Yosemite. I have to copy files from one folder to another folder on network drive. The code works fine in Windows 7, but the same code does not work in Mac. The files are on Windows Server. So, with a bit of research online, I found that we can use Apache Commons VFS, FileManagerSystem to access network files / folders.
Is there anyone who can share code to that?
public class CopyFiles {
public static void main (String[] args){
File source = new File ("smb://abcserver/TestFolder1/TestFile.xlsx");
File dest = new File ("smb://abcserver/TestFolder2/TestFile_Mac.xlsx");
try
{
FileUtils.copyFile(source, dest);
System.out.println("File Copied");
}
catch(IOException ie)
{
ie.printStackTrace();
}
}
}