com.android.ddmlib
Class FileListingService.FileEntry

java.lang.Object
  extended by com.android.ddmlib.FileListingService.FileEntry
Enclosing class:
FileListingService

public static final class FileListingService.FileEntry
extends Object

Represents an entry in a directory. This can be a file or a directory.


Method Summary
static String escape(String entryName)
          Returns an escaped version of the entry name.
protected  void fillPathBuilder(StringBuilder pathBuilder, boolean escapePath)
          Recursively fills the pathBuilder with the full path
protected  void fillPathSegments(ArrayList<String> list)
          Recursively fills the segment list with the full path.
 FileListingService.FileEntry findChild(String name)
          Returns the child FileListingService.FileEntry matching the name.
 FileListingService.FileEntry[] getCachedChildren()
          Returns the cached children of the entry.
 String getDate()
          Returns the date string of the entry, as returned by ls.
 String getFullEscapedPath()
          Return the fully escaped path of the entry.
 String getFullPath()
          Return the full path of the entry.
 String getInfo()
          Returns the extra info for the entry.
 String getName()
          Returns the name of the entry
 FileListingService.FileEntry getParent()
          Returns the parent entry.
 String[] getPathSegments()
          Returns the path as a list of segments.
 String getPermissions()
          Returns the permission string of the entry, as returned by ls.
 String getSize()
          Returns the size string of the entry, as returned by ls.
 int getSizeValue()
          Returns the size of the entry.
 String getTime()
          Returns the time string of the entry, as returned by ls.
 int getType()
          Returns true if the entry is a directory, false otherwise;
 boolean isAppFileName()
          Returns if the file name is an application package name.
 boolean isApplicationPackage()
          Returns if the entry is a valid application package.
 boolean isDirectory()
          Returns if the entry is a folder or a link to a folder.
 boolean isRoot()
          Returns whether the entry is the root.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Returns the name of the entry


getSize

public String getSize()
Returns the size string of the entry, as returned by ls.


getSizeValue

public int getSizeValue()
Returns the size of the entry.


getDate

public String getDate()
Returns the date string of the entry, as returned by ls.


getTime

public String getTime()
Returns the time string of the entry, as returned by ls.


getPermissions

public String getPermissions()
Returns the permission string of the entry, as returned by ls.


getInfo

public String getInfo()
Returns the extra info for the entry.

For a link, it will be a description of the link.

For an application apk file it will be the application package as returned by the Package Manager.


getFullPath

public String getFullPath()
Return the full path of the entry.

Returns:
a path string using FileListingService.FILE_SEPARATOR as separator.

getFullEscapedPath

public String getFullEscapedPath()
Return the fully escaped path of the entry. This path is safe to use in a shell command line.

Returns:
a path string using FileListingService.FILE_SEPARATOR as separator

getPathSegments

public String[] getPathSegments()
Returns the path as a list of segments.


getType

public int getType()
Returns true if the entry is a directory, false otherwise;


isDirectory

public boolean isDirectory()
Returns if the entry is a folder or a link to a folder.


getParent

public FileListingService.FileEntry getParent()
Returns the parent entry.


getCachedChildren

public FileListingService.FileEntry[] getCachedChildren()
Returns the cached children of the entry. This returns the cache created from calling FileListingService.getChildren().


findChild

public FileListingService.FileEntry findChild(String name)
Returns the child FileListingService.FileEntry matching the name. This uses the cached children list.

Parameters:
name - the name of the child to return.
Returns:
the FileEntry matching the name or null.

isRoot

public boolean isRoot()
Returns whether the entry is the root.


isApplicationPackage

public boolean isApplicationPackage()
Returns if the entry is a valid application package.


isAppFileName

public boolean isAppFileName()
Returns if the file name is an application package name.


fillPathBuilder

protected void fillPathBuilder(StringBuilder pathBuilder,
                               boolean escapePath)
Recursively fills the pathBuilder with the full path

Parameters:
pathBuilder - a StringBuilder used to create the path.
escapePath - Whether the path need to be escaped for consumption by a shell command line.

fillPathSegments

protected void fillPathSegments(ArrayList<String> list)
Recursively fills the segment list with the full path.

Parameters:
list - The list of segments to fill.

escape

public static String escape(String entryName)
Returns an escaped version of the entry name.

Parameters:
entryName -


Copyright © 2008-2012. All Rights Reserved.