FileDocCategorySizeDatePackage
FileWrapper.javaAPI DocAndroid 1.5 API2317Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources.manager.files

FileWrapper

public class FileWrapper extends Object implements IAbstractFile
An implementation of {@link IAbstractFile} on top of a {@link File} object.

Fields Summary
private File
mFile
Constructors Summary
public FileWrapper(File file)
Constructs a {@link FileWrapper} object. If {@link File#isFile()} returns false then an {@link IOException} is thrown.

        if (file.isFile() == false) {
            throw new IOException("FileWrapper must wrap a File object representing an existing file!"); //$NON-NLS-1$
        }
        
        mFile = file;
    
Methods Summary
public booleanequals(java.lang.Object obj)

        if (obj instanceof FileWrapper) {
            return mFile.equals(((FileWrapper)obj).mFile);
        }
        
        if (obj instanceof File) {
            return mFile.equals(obj);
        }

        return super.equals(obj);
    
public java.io.InputStreamgetContents()

        try {
            return new FileInputStream(mFile);
        } catch (FileNotFoundException e) {
            // we'll return null below.
        }
        
        return null;
    
public org.eclipse.core.resources.IFilegetIFile()

        return null;
    
public java.lang.StringgetName()

        return mFile.getName();
    
public java.lang.StringgetOsLocation()

        return mFile.getAbsolutePath();
    
public inthashCode()

        return mFile.hashCode();