Get hidden folders in blackberry
I am making a browser in my application where I want to get all the folders and subfolders even if they are hidden. The code which I used is the following:
try {
FileConnection fileConnection = (FileConnection)Connector.open(path);
if (fileConnection.isDirectory()) {
Enumeration directoryEnumerator = fileConnection.list();
Vector contentVector = new Vector();
while(directoryEnumerator.hasMoreElements()) {
contentVector.addElement(directoryEnumerator.nextElement());
}
fileConnection.close();
}
} catch (Exception ex) { }
But using the FileConnection and the Connector, I didn't get the hidden files and directories ... How to get开发者_如何学C them? Thanks in advance
What version of JDE are you using?
You should be able to do this:
Enumeration directoryEnumerator = fileConnection.list("*", true);
You can read more in the Blackberry Javadoc
Use FileConnection.list(filter, includeHidden)
method:
Enumeration directoryEnumerator = fileConnection.list("*", true);
精彩评论