English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i have a image in a path called myfolder/images/first.PNG
if suppose the image is not available in that location then i should load myfolder/images/blank.PNG in the JSP page.

what code should i use to do the check??

2006-08-29 16:37:53 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

make the file instance to a URI object and check the file existing

URI uri = new URI();
File f = new File(uri);
if(f.exists()){

}

2006-08-30 18:06:56 · answer #1 · answered by Anonymous · 0 0

File f = new File("myfolder/images/first.PNG");
if (f.exists()) {
} else {
}

How's that?

2006-08-29 23:42:37 · answer #2 · answered by Andy T 7 · 1 0

fedest.com, questions and answers