Package org.apache.openjpa.lib.meta
Class FileMetaDataIterator
- java.lang.Object
-
- org.apache.openjpa.lib.meta.FileMetaDataIterator
-
- All Implemented Interfaces:
MetaDataIterator
,Closeable
public class FileMetaDataIterator extends java.lang.Object implements MetaDataIterator
Iterator over a file, or over all metadata resources below a given directory.- Author:
- Abe White
-
-
Constructor Summary
Constructors Constructor Description FileMetaDataIterator(java.io.File file)
Constructor; supply metadata file.FileMetaDataIterator(java.io.File dir, MetaDataFilter filter)
Constructor; supply root of directory tree to search and optional file filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the resources used by this iterator.java.io.File
getFile()
Return the last-iterated metadata resource content as a file, or null if not an extant file.java.io.InputStream
getInputStream()
Return the last-iterated metadata resource content as a stream.boolean
hasNext()
Return whether there is another resource to iterate over.java.net.URL
next()
Return the next metadata resource.
-
-
-
Constructor Detail
-
FileMetaDataIterator
public FileMetaDataIterator(java.io.File file)
Constructor; supply metadata file.
-
FileMetaDataIterator
public FileMetaDataIterator(java.io.File dir, MetaDataFilter filter) throws java.io.IOException
Constructor; supply root of directory tree to search and optional file filter.- Throws:
java.io.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 interfaceMetaDataIterator
-
next
public java.net.URL next() throws java.io.IOException
Description copied from interface:MetaDataIterator
Return the next metadata resource.- Specified by:
next
in interfaceMetaDataIterator
- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Description copied from interface:MetaDataIterator
Return the last-iterated metadata resource content as a stream.- Specified by:
getInputStream
in interfaceMetaDataIterator
- Throws:
java.io.IOException
-
getFile
public java.io.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 interfaceMetaDataIterator
-
close
public void close()
Description copied from interface:MetaDataIterator
Close the resources used by this iterator.- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceMetaDataIterator
-
-