My Java application requires access to a large excel file (1GB+ in size) saved on remote shared folder. I\'m using SmbFile to get the file with authenticati
It's just a matter of structure I guess, with SmbFile we have two arguments while with File we have just one argument. So, my Idea is to declare a File with the same path of the SmbFile and try to handle your file. For example, in my I want to delete recursively the content of my folder :
SmbFile sFile = new SmbFile(path, auth)
if (sFile.exists()) {
File file = new File(path);
deleteDirectory(file);
}
boolean deleteDirectory(File directoryToBeDeleted) {
File[] allContents = directoryToBeDeleted.listFiles();
if (allContents != null) {
for (File file : allContents) {
deleteDirectory(file);
}
}
return directoryToBeDeleted.delete();
}
I hope this peace of code help you, and sorry for my english !