View Single Post
  #1546  
Old 19.10.2020, 19:15
Artex Artex is offline
I will play nice!
 
Join Date: Oct 2020
Posts: 4
Default Move Completed Downloads to alternate folder, into a subfolder of the same name

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!
Reply With Quote