I'm trying to display all my user files using java as follows...
public static String Tree(File file)
{
if(file.isDirectory()==true)
{
File fr[]=file.listFiles();
No_fold++;
for(int i=0;i<fr.length;i++)
{
Tree(fr[i]);
}
}
else
{
X+=file.getPath()+"\n";
No_files++;
}
return X;
}
works perfectly while displaying my documents files... But the following exception is thrown while trying to display the files from C:/Users/username
at com.monster.app.__SHELL137.run(__SHELL137.java:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at bluej.runtime.ExecServer$3.run(ExecServer.java:725)
Please help me regarding this.. Thnk U