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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -