com.android.sdklib
Class FileOpFileWrapper
java.lang.Object
com.android.sdklib.FileOpFileWrapper
- All Implemented Interfaces:
- com.android.io.IAbstractFile, com.android.io.IAbstractFolder, com.android.io.IAbstractResource
public class FileOpFileWrapper
- extends java.lang.Object
- implements com.android.io.IAbstractFile, com.android.io.IAbstractFolder
An IAbstractFile or IAbstractFolder that wraps a File and uses a
FileOp for file operations, to allow mocking.
| Nested classes/interfaces inherited from interface com.android.io.IAbstractFile |
com.android.io.IAbstractFile.PreferredWriteMode |
| Nested classes/interfaces inherited from interface com.android.io.IAbstractFolder |
com.android.io.IAbstractFolder.FilenameFilter |
|
Constructor Summary |
FileOpFileWrapper(java.io.File file,
com.android.repository.io.FileOp fop,
boolean isFolder)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileOpFileWrapper
public FileOpFileWrapper(java.io.File file,
com.android.repository.io.FileOp fop,
boolean isFolder)
getContents
public java.io.InputStream getContents()
throws com.android.io.StreamException
- Specified by:
getContents in interface com.android.io.IAbstractFile
- Throws:
com.android.io.StreamException
setContents
public void setContents(java.io.InputStream source)
throws com.android.io.StreamException
- Specified by:
setContents in interface com.android.io.IAbstractFile
- Throws:
com.android.io.StreamException
getOutputStream
public java.io.OutputStream getOutputStream()
throws com.android.io.StreamException
- Specified by:
getOutputStream in interface com.android.io.IAbstractFile
- Throws:
com.android.io.StreamException
getPreferredWriteMode
public com.android.io.IAbstractFile.PreferredWriteMode getPreferredWriteMode()
- Specified by:
getPreferredWriteMode in interface com.android.io.IAbstractFile
getModificationStamp
public long getModificationStamp()
- Specified by:
getModificationStamp in interface com.android.io.IAbstractFile
getName
public java.lang.String getName()
- Specified by:
getName in interface com.android.io.IAbstractResource
getOsLocation
public java.lang.String getOsLocation()
- Specified by:
getOsLocation in interface com.android.io.IAbstractResource
exists
public boolean exists()
- Specified by:
exists in interface com.android.io.IAbstractResource
getParentFolder
public com.android.io.IAbstractFolder getParentFolder()
- Specified by:
getParentFolder in interface com.android.io.IAbstractResource
delete
public boolean delete()
- Specified by:
delete in interface com.android.io.IAbstractResource
hasFile
public boolean hasFile(java.lang.String name)
- Specified by:
hasFile in interface com.android.io.IAbstractFolder
getFile
public com.android.io.IAbstractFile getFile(java.lang.String name)
- Specified by:
getFile in interface com.android.io.IAbstractFolder
getFolder
public com.android.io.IAbstractFolder getFolder(java.lang.String name)
- Specified by:
getFolder in interface com.android.io.IAbstractFolder
listMembers
public com.android.io.IAbstractResource[] listMembers()
- Specified by:
listMembers in interface com.android.io.IAbstractFolder
list
public java.lang.String[] list(com.android.io.IAbstractFolder.FilenameFilter filter)
- Specified by:
list in interface com.android.io.IAbstractFolder