Thursday, July 11, 2013

JAVA: The filename, directory name, or volume label syntax is incorrect

While doing file copy operation using java, if we come across an error saying

"The filename, directory name, or volume label syntax is incorrect"

then check the source filename which we are trying to copy and ensure there is no white space before or after the filename.

Better to use fileName.trim() before trying to copy

No comments:

Post a Comment