org.apache.aries.application.utils.filesystem.impl
Class DirectoryImpl

java.lang.Object
  extended by org.apache.aries.application.utils.filesystem.impl.FileImpl
      extended by org.apache.aries.application.utils.filesystem.impl.DirectoryImpl
All Implemented Interfaces:
Iterable<IFile>, IDirectory, IFile

public class DirectoryImpl
extends FileImpl
implements IDirectory

An IDirectory representing a java.io.File whose isDirectory method returns true.


Field Summary
 
Fields inherited from class org.apache.aries.application.utils.filesystem.impl.FileImpl
file, rootDir, rootDirFile
 
Constructor Summary
DirectoryImpl(File dir, File rootFile)
           
 
Method Summary
 IDirectory convert()
           
 IFile getFile(String name)
           
 long getLastModified()
           
 IDirectory getParent()
           
 boolean isRoot()
           
 Iterator<IFile> iterator()
           
 List<IFile> listAllFiles()
           
 List<IFile> listFiles()
           
 InputStream open()
           
 
Methods inherited from class org.apache.aries.application.utils.filesystem.impl.FileImpl
equals, getName, getRoot, getSize, hashCode, isDirectory, isFile, toString, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.aries.application.filesystem.IFile
getName, getRoot, getSize, isDirectory, isFile, toURL
 

Constructor Detail

DirectoryImpl

public DirectoryImpl(File dir,
                     File rootFile)
Parameters:
dir - the file to represent.
rootFile - the file that represents the FS root.
Method Detail

getFile

public IFile getFile(String name)
Specified by:
getFile in interface IDirectory

isRoot

public boolean isRoot()
Specified by:
isRoot in interface IDirectory

listFiles

public List<IFile> listFiles()
Specified by:
listFiles in interface IDirectory

listAllFiles

public List<IFile> listAllFiles()
Specified by:
listAllFiles in interface IDirectory

iterator

public Iterator<IFile> iterator()
Specified by:
iterator in interface Iterable<IFile>

getParent

public IDirectory getParent()
Specified by:
getParent in interface IFile
Overrides:
getParent in class FileImpl

convert

public IDirectory convert()
Specified by:
convert in interface IFile
Overrides:
convert in class FileImpl

open

public InputStream open()
                 throws IOException
Specified by:
open in interface IFile
Overrides:
open in class FileImpl
Throws:
IOException

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface IFile
Overrides:
getLastModified in class FileImpl


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