java - .getAbsoultePath prints the ProjectPath instead of SystemPath? -


there little problem file.getabsolutepath() method , tried f.getcanonicalpath(); method.

instead of

c:/documents , settings

it prints

c:\users\me\documents\netbeansprojects\filec\documents , settings

could maybe explain how should changed ?

thank you

    f = new file(c://);     fs = f.list();      for(string fsv : fs) {      f = new file(fsv);      string ap = f.getabsolutepath();      system.out.println(ap); 

in fs names of files in c: , if give file name file object add name current working directory. change code that:

    file f = new file("c:/");     file[] fs = f.listfiles();     (file fsv : fs) {         string ap = fsv.getabsolutepath();         system.out.println(ap);     } 

i hope helps.


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -