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 java.lang.Object

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


Method Summary
static java.lang.String escape(java.lang.String entryName)
          Returns an escaped version of the entry name.
protected  void fillPathBuilder(java.lang.StringBuilder pathBuilder, boolean escapePath)
          Recursively fills the pathBuilder with the full path
protected  void fillPathSegments(java.util.ArrayList<java.lang.String> list)
          Recursively fills the segment list with the full path.
 FileListingService.FileEntry findChild(java.lang.String name)
          Returns the child FileListingService.FileEntry matching the name.
 FileListingService.FileEntry[] getCachedChildren()
          Returns the cached children of the entry.
 java.lang.String getDate()
          Returns the date string of the entry, as returned by ls.
 java.lang.String getFullEscapedPath()
          Return the fully escaped path of the entry.
 java.lang.String getFullPath()
          Return the full path of the entry.
 java.lang.String getGroup()
          Returns the group owner of the entry, as returned by ls.
 java.lang.String getInfo()
          Returns the extra info for the entry.
 java.lang.String getName()
          Returns the name of the entry
 java.lang.String getOwner()
          Returns the owner string of the entry, as returned by ls.
 FileListingService.FileEntry getParent()
          Returns the parent entry.
 java.lang.String[] getPathSegments()
          Returns the path as a list of segments.
 java.lang.String getPermissions()
          Returns the permission string of the entry, as returned by ls.
 java.lang.String getSize()
          Returns the size string of the entry, as returned by ls.
 int getSizeValue()
          Returns the size of the entry.
 java.lang.String getTime()
          Returns the time string of the entry, as returned by ls.
 int getType()
          Returns the Entry type as an int, which will match one of the TYPE_(...) constants
 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.
 void setType(int type)
          Sets a new type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Returns the name of the entry


getSize

public java.lang.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 java.lang.String getDate()
Returns the date string of the entry, as returned by ls.


getTime

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


getPermissions

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


getOwner

public java.lang.String getOwner()
Returns the owner string of the entry, as returned by ls.


getGroup

public java.lang.String getGroup()
Returns the group owner of the entry, as returned by ls.


getInfo

public java.lang.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 java.lang.String getFullPath()
Return the full path of the entry.

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

getFullEscapedPath

public java.lang.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 java.lang.String[] getPathSegments()
Returns the path as a list of segments.


getType

public int getType()
Returns the Entry type as an int, which will match one of the TYPE_(...) constants


setType

public void setType(int type)
Sets a new type.


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(java.lang.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(java.lang.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(java.util.ArrayList<java.lang.String> list)
Recursively fills the segment list with the full path.

Parameters:
list - The list of segments to fill.

escape

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

Parameters:
entryName -