String command = "ls -l " + entry.getFullEscapedPath(); //$NON-NLS-1$
private void doLsAndThrow(FileEntry entry) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { // create a list that will receive the list of the entries ArrayList<FileEntry> entryList = new ArrayList<FileEntry>(); // create a list that will receive the link to compute post ls; ArrayList<String> linkList = new ArrayList<String>(); try { // create the command String command = "ls -l " + entry.getFullEscapedPath(); //$NON-NLS-1$ if (entry.isDirectory()) { // If we expect a file to behave like a directory, we should stick a "/" at the end. // This is a good habit, and is mandatory for symlinks-to-directories, which will // otherwise behave like symlinks. command += FILE_SEPARATOR; } // create the receiver object that will parse the result from ls LsReceiver receiver = new LsReceiver(entry, entryList, linkList); // call ls. mDevice.executeShellCommand(command, receiver); // finish the process of the receiver to handle links receiver.finishLinks(mDevice, entryList); } finally { // at this point we need to refresh the viewer entry.fetchTime = System.currentTimeMillis(); // sort the children and set them as the new children Collections.sort(entryList, FileEntry.sEntryComparator); entry.setChildren(entryList); } }
final String command = String.format("ls -l -d %s%s", entry.getFullEscapedPath(), FILE_SEPARATOR);