FileEntry[]\r
getChildren()\r
{\r
- // first thing we do is check the cache, and if we already have a recent\r
- // enough children list, we just return that.\r
- if ( needFetch() )\r
+ // if there's no receiver, then this is a synchronous call, and we\r
+ // return the result of ls\r
+ LsReceiver receiver = new LsReceiver( this );\r
+ try\r
{\r
- // if there's no receiver, then this is a synchronous call, and we\r
- // return the result of ls\r
- LsReceiver receiver = new LsReceiver( this );\r
- try\r
- {\r
- // create the command\r
- final String path = addTailingPath( FILE_ROOT, ( getType().isLink() )?getLinkSource():getFullEscapedPath() );\r
- final String command = String.format( CMD_LS_WITH_STYLE, getStringWithDoubleQuote( path ) );\r
+ // create the command\r
+ final String path = addTailingPath( FILE_ROOT, ( getType().isLink() )?getLinkSource():getFullEscapedPath() );\r
+ final String command = String.format( CMD_LS_WITH_STYLE, getStringWithDoubleQuote( path ) );\r
\r
- // create the receiver object that will parse the result from ls\r
- // call ls.\r
- this.device.executeShellCommand( command, receiver );\r
- }\r
- catch ( final IOException e )\r
- {\r
- // catch all and do nothing.\r
- Log.e("sdb", "excute doLS failed:" + e);\r
- }\r
- finally\r
- {\r
- tryClose( receiver );\r
- }\r
-\r
- // at this point we need to refresh the viewer\r
- this.fetchTime = System.currentTimeMillis();\r
-\r
- // sort the children and set them as the new children\r
- this.children = receiver.getEntries();\r
+ // create the receiver object that will parse the result from ls\r
+ // call ls.\r
+ this.device.executeShellCommand( command, receiver );\r
+ }\r
+ catch ( final IOException e )\r
+ {\r
+ // catch all and do nothing.\r
+ Log.e("sdb", "excute doLS failed:" + e);\r
+ }\r
+ finally\r
+ {\r
+ tryClose( receiver );\r
}\r
+ // at this point we need to refresh the viewer\r
+ this.fetchTime = System.currentTimeMillis();\r
+\r
+ // sort the children and set them as the new children\r
+ this.children = receiver.getEntries();\r
\r
return children.toArray( new FileEntry[children.size()] );\r
}\r
{\r
if(useCache == USE_CACHE)\r
{\r
- return children.toArray( new FileEntry[children.size()] );\r
+ if(needFetch())\r
+ {\r
+ return getChildren();\r
+ }\r
+ else\r
+ {\r
+ return children.toArray( new FileEntry[children.size()] );\r
+ }\r
}\r
-\r
return getChildren();\r
}\r
\r