开发者

Get hidden folders in blackberry

开发者 https://www.devze.com 2023-04-02 19:17 出处:网络
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:

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消