Wednesday 15 September 2010

copy files in java with path containing whitespace -


How to copy files in Java, where is the file name or white space in its path? I have used this method:

  import static java.nio.file. *; Files.copy (source, target, REPLACE_EXISTING);   

source & amp; The target path path is determined using the .get () method. But it throws NoSuchFileException for the path with white spots. The target system is Ubuntu. There is no acceptable answer to this question.

I did the following with a problem (empty space in directory and file names) < Pre> path source = path. ("C: \\ user \\ plawrey \\ Google Drive \\ IFAQ - Chronicle. Gdoc"); Path target = path Gate ("c: \\ user \\ plawrey \\ Google Drive \\ IFAQ - Chronicle2 GDOK"); Files.copy (source, target, standardCopyoption .REPLACE_EXISTING);

The problem is that your target directory does not exist.

No comments:

Post a Comment