org.apache.aries.application.filesystem
Interface IFile

All Known Subinterfaces:
IDirectory

public interface IFile

A virtual file on the virtual file system. This may represent a file or a directory.


Method Summary
 IDirectory convert()
           
 long getLastModified()
           
 String getName()
           
 IDirectory getParent()
           
 IDirectory getRoot()
           
 long getSize()
           
 boolean isDirectory()
           
 boolean isFile()
           
 InputStream open()
          The input stream returned by this method should always be closed after use.
 URL toURL()
           
 

Method Detail

getName

String getName()
Returns:
the name of the file relative to the root of the virtual FS.

isDirectory

boolean isDirectory()
Returns:
true iff this IFile is also an IDirectory

isFile

boolean isFile()
Returns:
true iff this IFile is not an IDirectory

getLastModified

long getLastModified()
Returns:
the last modified date of the file.

getSize

long getSize()
Returns:
the size of the file.

convert

IDirectory convert()
Returns:
if this is a directory return this as an IDirectory, otherwise return null.

getParent

IDirectory getParent()
Returns:
returns the parent directory of this IFile, or null if this is the root.

open

InputStream open()
                 throws IOException,
                        UnsupportedOperationException
The input stream returned by this method should always be closed after use.

Returns:
An InputStream to read the file from.
Throws:
IOException
UnsupportedOperationException - If the IFile is also an IDirectory.

getRoot

IDirectory getRoot()
Returns:
the root of this file system.

toURL

URL toURL()
          throws MalformedURLException
Returns:
a URL that can be used to get at this file at a later date.
Throws:
MalformedURLException


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.