IFileEntry

public interface IFileEntry

com.android.tradefed.device.IFileEntry


Interface definition that provides simpler, mockable contract to FileEntry methods.

TODO: move this into ddmlib

Summary

Public methods

abstract IFileEntry findChild(String name)

Finds a child IFileEntry with given name.

abstract getChildren(boolean useCache)

Returns the children of a IFileEntry.

abstract String getDate()

Wrapper for FileEntry.getDate().

abstract FileListingService.FileEntry getFileEntry()

Return reference to the ddmlib FileEntry.

abstract String getFullEscapedPath()

Wrapper for FileEntry.getFullEscapedPath().

abstract String getFullPath()

Wrapper for FileEntry.getFullPath().

abstract String getName()

Wrapper for FileEntry.getName().

abstract String getPermissions()

Wrapper for FileEntry.getPermissions().

abstract String getTime()

Wrapper for FileEntry.getTime().

abstract boolean isAppFileName()

Wrapper for FileEntry.isAppFileName().

abstract boolean isDirectory()

Wrapper for FileEntry.isDirectory().

Public methods

findChild

public abstract IFileEntry findChild (String name)

Finds a child IFileEntry with given name.

Basically a wrapper for FileEntry.findChild(String) that will also first search the cached children for file with given name, and if not found, refresh the cached child file list and attempt again.

Parameters
name String

Returns
IFileEntry

Throws
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getChildren

public abstract  getChildren (boolean useCache)

Returns the children of a IFileEntry.

Basically a synchronous wrapper for FileListingService.getChildren(FileEntry, boolean, FileListingService.IListingReceiver)

Parameters
useCache boolean: true if the cached children should be returned if available. false if a new ls command should be forced.

Returns
list of sub files

Throws
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getDate

public abstract String getDate ()

Wrapper for FileEntry.getDate().

Returns
String

getFileEntry

public abstract FileListingService.FileEntry getFileEntry ()

Return reference to the ddmlib FileEntry.

Returns
FileListingService.FileEntry

getFullEscapedPath

public abstract String getFullEscapedPath ()

Wrapper for FileEntry.getFullEscapedPath().

Returns
String

getFullPath

public abstract String getFullPath ()

Wrapper for FileEntry.getFullPath().

Returns
String

getName

public abstract String getName ()

Wrapper for FileEntry.getName().

Returns
String

getPermissions

public abstract String getPermissions ()

Wrapper for FileEntry.getPermissions().

Returns
String

getTime

public abstract String getTime ()

Wrapper for FileEntry.getTime().

Returns
String

isAppFileName

public abstract boolean isAppFileName ()

Wrapper for FileEntry.isAppFileName().

Returns
boolean

isDirectory

public abstract boolean isDirectory ()

Wrapper for FileEntry.isDirectory().

Returns
boolean