im sure u have seen jme applications listing only the directories. does it have anything to do with the list(String,boolean) method of FileConnection? if yes, how to use it to list only directories?
Another way could be to open a FileConnection to each item in the enumeration returned by list(), and use isDirectory() on the opened FileConnection.
Your solution is a little bit cleaner in code. The big disadvantage is that opening and closing FileConnection could take some time on some platforms.
you are using the correct method, but the method has no support for filtering on directories. Thus you have to figure out for yourself which is a directory and which is a file.
well, i found out. i donno whether it is legal or not, but i was curious about how opera mini splayed only the names of directories when downloading a file. so i got JAD, and decompiled the jar, and after a long hunt, realised that its a very simple technique. Directory names end with "/". fo, u can just scan through the Enumeration returned by .list(), for those names which end with "/"
Yes, using "/" to figure out which is a directory or not should be the best bet. Nice to hear that you figured it out :)
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.