Class FileImpl
- java.lang.Object
-
- org.apache.aries.util.filesystem.impl.FileImpl
-
- All Implemented Interfaces:
IFile
- Direct Known Subclasses:
DirectoryImpl
public class FileImpl extends java.lang.Object implements IFile
An implementation of IFile that represents a java.io.File.
-
-
Constructor Summary
Constructors Constructor Description FileImpl(java.io.File f, java.io.File rootFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDirectory
convert()
IDirectory
convertNested()
boolean
equals(java.lang.Object obj)
long
getLastModified()
java.lang.String
getName()
IDirectory
getParent()
IDirectory
getRoot()
long
getSize()
int
hashCode()
boolean
isDirectory()
boolean
isFile()
java.io.InputStream
open()
The input stream returned by this method should always be closed after use.java.lang.String
toString()
java.net.URL
toURL()
-
-
-
Method Detail
-
convert
public IDirectory convert()
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceIFile
- Returns:
- the last modified date of the file.
-
getName
public java.lang.String getName()
-
getParent
public IDirectory getParent()
-
getSize
public long getSize()
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory
in interfaceIFile
- Returns:
- true iff this IFile is also an IDirectory
-
isFile
public boolean isFile()
-
open
public java.io.InputStream open() throws java.io.IOException
Description copied from interface:IFile
The input stream returned by this method should always be closed after use.
-
getRoot
public IDirectory getRoot()
-
toURL
public java.net.URL toURL() throws java.net.MalformedURLException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
convertNested
public IDirectory convertNested()
- Specified by:
convertNested
in interfaceIFile
- Returns:
- if this is a directory or an archive, returns the opened IDirectory
-
-