org.apache.openjpa.lib.meta
Class FileMetaDataIterator

java.lang.Object
  extended by org.apache.openjpa.lib.meta.FileMetaDataIterator
All Implemented Interfaces:
MetaDataIterator, Closeable

public class FileMetaDataIterator
extends Object
implements MetaDataIterator

Iterator over a file, or over all metadata resources below a given directory.

Author:
Abe White

Constructor Summary
FileMetaDataIterator(File file)
          Constructor; supply metadata file.
FileMetaDataIterator(File dir, MetaDataFilter filter)
          Constructor; supply root of directory tree to search and optional file filter.
 
Method Summary
 void close()
          Close the resources used by this iterator.
 File getFile()
          Return the last-iterated metadata resource content as a file, or null if not an extant file.
 InputStream getInputStream()
          Return the last-iterated metadata resource content as a stream.
 boolean hasNext()
          Return whether there is another resource to iterate over.
 Object next()
          Return the next metadata resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileMetaDataIterator

public FileMetaDataIterator(File file)
Constructor; supply metadata file.


FileMetaDataIterator

public FileMetaDataIterator(File dir,
                            MetaDataFilter filter)
                     throws IOException
Constructor; supply root of directory tree to search and optional file filter.

Throws:
IOException
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: MetaDataIterator
Return whether there is another resource to iterate over.

Specified by:
hasNext in interface MetaDataIterator

next

public Object next()
            throws IOException
Description copied from interface: MetaDataIterator
Return the next metadata resource.

Specified by:
next in interface MetaDataIterator
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: MetaDataIterator
Return the last-iterated metadata resource content as a stream.

Specified by:
getInputStream in interface MetaDataIterator
Throws:
IOException

getFile

public File getFile()
Description copied from interface: MetaDataIterator
Return the last-iterated metadata resource content as a file, or null if not an extant file.

Specified by:
getFile in interface MetaDataIterator

close

public void close()
Description copied from interface: MetaDataIterator
Close the resources used by this iterator.

Specified by:
close in interface MetaDataIterator
Specified by:
close in interface Closeable


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.