示例#1
0
        /// <summary>
        /// Does the LS.
        /// </summary>
        /// <param name="entry">The entry.</param>
        private void DoLS(FileEntry entry)
        {
            // create a list that will receive the list of the entries
            List <FileEntry> entryList = new List <FileEntry> ( );

            // create a list that will receive the link to compute post ls;
            List <String> linkList = new List <String> ( );

            try {
                // create the command
                String command = String.Format(TOOLBOX_LS, entry.FullPath);
                // create the receiver object that will parse the result from ls
                ListingServiceReceiver receiver = new ListingServiceReceiver(entry, entryList, linkList);

                // call ls.
                Device.ExecuteShellCommand(command, receiver);

                // finish the process of the receiver to handle links
                receiver.FinishLinks( );
            } catch (IOException e) {
                Log.e("ddms", e);
                throw;
            }


            // at this point we need to refresh the viewer
            entry.FetchTime = DateTime.Now.CurrentTimeMillis( );
            // sort the children and set them as the new children
            entryList.Sort(new FileEntry.FileEntryComparer( ));
            entry.Children = entryList;
        }
示例#2
0
        /// <summary>
        /// Does the LS.
        /// </summary>
        /// <param name="entry">The entry.</param>
        private void DoLS( FileEntry entry )
        {
            // create a list that will receive the list of the entries
            List<FileEntry> entryList = new List<FileEntry> ( );

            // create a list that will receive the link to compute post ls;
            List<String> linkList = new List<String> ( );

            try {
                // create the command
                String command = String.Format ( ForceBusyBox ? BUSYBOX_LS : TOOLBOX_LS, entry.FullPath );
                // create the receiver object that will parse the result from ls
                ListingServiceReceiver receiver = new ListingServiceReceiver ( entry, entryList, linkList );

                // call ls.
                Device.ExecuteShellCommand ( command, receiver );

                // finish the process of the receiver to handle links
                receiver.FinishLinks ( );
            } catch ( IOException e ) {
                Log.e ( "ddms", e );
                throw;
            }

            // at this point we need to refresh the viewer
            entry.FetchTime = DateTime.Now.CurrentTimeMillis ( );
            // sort the children and set them as the new children
            entryList.Sort ( new FileEntry.FileEntryComparer ( ) );
            entry.Children = entryList;
        }