It looks to me like your program cannot find the location to upload the file.
In your code, you have this line: String destination = “::localhost:Portofolio:HRD Files:document”;
Is this location referencing a directory within a Watchfolder? If it is not, then Portfolio will not be able to find it to upload the file. The other thing you may want to look at is localhost in your destination path. You may find that Portfolio is referring to this as a machine name and not localhost.
If you want to be sure what path that Portfolio is using. Connect to the server using the Webclient, select your Watchfolder and double click on it. You should see an image like this:
In the above screenshot, the Watchfolder path is ::GARM:Storage:Autosync:Pins and Things. If I wanted to upload to a subfolder called Upload, then my destination path would be ::GARM:Storage:Autosync:Pins and Things:Upload
If I were to use a path other than what is available in the Watchfolder, for example ::GARM:Storage:Upload, then I would get a javax.servlet.ServletException: NotFound error, because the location cannot be found by Portfolio.
I hope this helps, if you have any further questions, please let me know.