java - check if user-entered filename/path is valid -


possible duplicate:
is there way in java determine if path valid without attempting create file?

i'm trying let user enter path wants saved. open editor, , let him enter path...

but how can check if entered string valid path?

if user forgets type in "/" @ end - not problem, can manually check that...

but cant manually check everything:

a space @ end (/folder /)

question marks.

greater - less symbols (/folder:->/

(back)slashes \folder\

and stuff

is there convenient way in java check that?

generic java file directory or exists, this answer:

file file = new file("c:\\cygwin\\cygwin.bat"); if (!file.isdirectory())    file = file.getparentfile(); if (file.exists()) {     ... } 

however, android (question tagged android), i'll have into...


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -