If you wanted to copy a file from one shared location to another shared location. You can this like this ArrayList<SmbFile> readFiles = readFolder?.listFiles() for(file in readFiles ){ String name = file.properties.getKey("name") destinationFolder = new SmbFile(foldersInfo?.destinationFolder+"/"+name,auth) destinationFolder.createNewFile() file.copyTo(destinationFolder) } The file which you want to copy that file must be...
I just added a BufferedInputStream and this solved the issue BufferedInputStream buf = new BufferedInputStream(smbFileInputStream); ...
Ended up putting the credentials in a template at the root level, and setting parameters for the other fields. That way every project can customize the working folders and such, while using the appropriate service credentials securely.
As indicated by the error message and what you are describing it is a file permission issue on the target server. Updated Confirmed (via comments) that it was a permissions issue when attempting to replace an existing file....