Possible Duplicate:
Is there a way in Java to determine if a path is valid without attempting to create a file?
I'm trying to let the user enter the path where he wants something to be saved. so basically i open an editor, and let him enter the path...
but how can i check if the entered string is a valid path?
if the user forgets to type in a "/" at the end - its not a problem, i can manually check for that...
but i cant manually check for everything:
a space at the end (/folder /)
question marks.
greater than - less than symbols (/folder:->/
(back)slashes \folder\
and all that stuff
is there a convenient way in java to check for that?