java - Coded path from getResource() doesn't work -


i'm trying folder

file imagesorg = new file(getclass().getresource("/stock").getpath()); 

i've printed out in console with

 system.out.println(imagesorg.getabsolutepath()); 

and there space within path changed %20 , because of rest of code doesn't work is:

 for(final file child : imagesorg.listfiles()) {                     system.out.println(child.getname());  } 

if put whole path in new file space instead of %20 works fine there easy solution this?

i recommand url decoder.

you can use this..

string result = java.net.urldecoder.decode(url, "utf-8");


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -