I am trying to get the names of all the directories and files that inside the tpo
directory on some server but
as I run the following code:
public static void main(String args[]) {
try {
File file = new File(new URI("http://xxx/tpo/"));
String list[] = file.list();
for(String name : list) {
System.out.println(name);
}
}catch(Exception exc) {
exc.printStackTrace();
}
}
I get the following exception :
java.lang.IllegalArgumentException: URI scheme is not "file"
at java.io.File.<init>(File.java:366)
at hack.List.main(List.java:17)
Why is that ? How do I get the file names and the names of the directories inside the tpo
directory.