IFileEntry

public interface IFileEntry

com.android.tradefed.device.IFileEntry


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

TODO: move this into ddmlib

Summary

Public methods

abstract IFileEntry findChild(String name)

Finds a child IFileEntry with given name.

abstract Collection<IFileEntry> getChildren(boolean useCache)

Returns the children of a IFileEntry.

abstract String getDate()

Wrapper for FileListingService.FileEntry.getDate().

abstract FileListingService.FileEntry getFileEntry()

Return reference to the ddmlib FileListingService.FileEntry.

abstract String getFullEscapedPath()

Wrapper for FileListingService.FileEntry.getFullEscapedPath().

abstract String getFullPath()

Wrapper for FileListingService.FileEntry.getFullPath().

abstract String getName()

Wrapper for FileListingService.FileEntry.getName().

abstract String getPermissions()

Wrapper for FileListingService.FileEntry.getPermissions().

abstract String getTime()

Wrapper for FileListingService.FileEntry.getTime().

abstract boolean isAppFileName()

Wrapper for FileListingService.FileEntry.isAppFileName().

abstract boolean isDirectory()

Wrapper for FileListingService.FileEntry.isDirectory().

Public methods

findChild

public abstract IFileEntry findChild (String name)

Finds a child IFileEntry with given name.

Basically a wrapper for FileListingService.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
DeviceNotAvailableException

getChildren

public abstract Collection<IFileEntry> 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
Collection<IFileEntry> list of sub files

Throws
DeviceNotAvailableException

getDate

public abstract String getDate ()

Wrapper for FileListingService.FileEntry.getDate().

Returns
String

getFileEntry

public abstract FileListingService.FileEntry getFileEntry ()

Return reference to the ddmlib FileListingService.FileEntry.

Returns
FileListingService.FileEntry

getFullEscapedPath

public abstract String getFullEscapedPath ()

Wrapper for FileListingService.FileEntry.getFullEscapedPath().

Returns
String

getFullPath

public abstract String getFullPath ()

Wrapper for FileListingService.FileEntry.getFullPath().

Returns
String

getName

public abstract String getName ()

Wrapper for FileListingService.FileEntry.getName().

Returns
String

getPermissions

public abstract String getPermissions ()

Wrapper for FileListingService.FileEntry.getPermissions().

Returns
String

getTime

public abstract String getTime ()

Wrapper for FileListingService.FileEntry.getTime().

Returns
String

isAppFileName

public abstract boolean isAppFileName ()

Wrapper for FileListingService.FileEntry.isAppFileName().

Returns
boolean

isDirectory

public abstract boolean isDirectory ()

Wrapper for FileListingService.FileEntry.isDirectory().

Returns
boolean