How can I check if there is an image file a particular location in workspace in java? -


i need check if image exists @ path given. have path. how trying it:

string imagepath = "_images/blogimages/filename.jpg"; file f = new file(imagepath); if (f.exists()) {      return imagepath; } else {      return "someotherpath"; } 

however, goes else. f.exists() doesn't seem working image file. need return imagepath when image exists @ given path. appreciated.


Comments