So similar to this:
// Move finished non-archive files, to user defined folder
// Trigger required: "A Download Stopped"
var destFolder = "c:/myFolder/movedFiles"; // <- Set destination folder.
if (link.isFinished() && !link.getArchive()) {
getPath(link.getDownloadPath()).moveTo(destFolder);
}
I'm looking for a way to move completed downloads into a 'subfolder' of the "c:/myFolder/movedFiles" that has the same name as the file or folder being downloaded.
So if JDownloader2 is downloading the following...
- C:\Downloads\TestFileFolder\TestFileName.txt
- C:\Downloads\TestFileFolder\TestSubfolder\SubfolderFile.txt
...then once completed, move them to:
- c:/myFolder/movedFiles/TestFileFolder
- c:/myFolder/movedFiles/TestFileFolder/TestSubfoldder
This would keep the structure intact.
Thanks!