[Title] fix a bug where connection explror does not update file(folder) list after...
authorshingil.kang <shingil.kang@samsung.com>
Tue, 11 Jun 2013 17:33:11 +0000 (02:33 +0900)
committershingil.kang <shingil.kang@samsung.com>
Tue, 11 Jun 2013 22:03:15 +0000 (07:03 +0900)
[Desc.]
[Issue]

Change-Id: Ia54834ac66524e7cfe0f97219751d848b3c6f5d9

org.tizen.common.sdblib/src/org/tizen/sdblib/service/FileEntry.java

index e314fdc..226f44d 100644 (file)
@@ -399,39 +399,33 @@ implements Comparable<FileEntry>
     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
@@ -442,9 +436,15 @@ implements Comparable<FileEntry>
     {\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