Package org.apache.openjpa.lib.meta
Class ZipFileMetaDataIterator
- java.lang.Object
 - 
- org.apache.openjpa.lib.meta.ZipFileMetaDataIterator
 
 
- 
- All Implemented Interfaces:
 MetaDataFilter.Resource,MetaDataIterator,Closeable
public class ZipFileMetaDataIterator extends Object implements MetaDataIterator, MetaDataFilter.Resource
Iterator over all metadata resources in a given zip file.- Author:
 - Abe White
 
 
- 
- 
Constructor Summary
Constructors Constructor Description ZipFileMetaDataIterator(URL url, MetaDataFilter filter)Constructor; supply zip/jar URL and optional file filter.ZipFileMetaDataIterator(ZipFile file, MetaDataFilter filter)Constructor; supply zip file and optional file filter. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the resources used by this iterator.byte[]getContent()Resource content.FilegetFile()Return the last-iterated metadata resource content as a file, or null if not an extant file.InputStreamgetInputStream()Return the last-iterated metadata resource content as a stream.StringgetName()The name of the resource.booleanhasNext()Return whether there is another resource to iterate over.Stringnext()Return the next metadata resource. 
 - 
 
- 
- 
Constructor Detail
- 
ZipFileMetaDataIterator
public ZipFileMetaDataIterator(URL url, MetaDataFilter filter) throws IOException
Constructor; supply zip/jar URL and optional file filter.- Throws:
 IOException
 
- 
ZipFileMetaDataIterator
public ZipFileMetaDataIterator(ZipFile file, MetaDataFilter filter)
Constructor; supply zip file and optional file filter. 
 - 
 
- 
Method Detail
- 
hasNext
public boolean hasNext() throws IOExceptionDescription copied from interface:MetaDataIteratorReturn whether there is another resource to iterate over.- Specified by:
 hasNextin interfaceMetaDataIterator- Throws:
 IOException
 
- 
next
public String next() throws IOException
Description copied from interface:MetaDataIteratorReturn the next metadata resource.- Specified by:
 nextin interfaceMetaDataIterator- Throws:
 IOException
 
- 
getInputStream
public InputStream getInputStream() throws IOException
Description copied from interface:MetaDataIteratorReturn the last-iterated metadata resource content as a stream.- Specified by:
 getInputStreamin interfaceMetaDataIterator- Throws:
 IOException
 
- 
getFile
public File getFile()
Description copied from interface:MetaDataIteratorReturn the last-iterated metadata resource content as a file, or null if not an extant file.- Specified by:
 getFilein interfaceMetaDataIterator
 
- 
close
public void close()
Description copied from interface:MetaDataIteratorClose the resources used by this iterator.- Specified by:
 closein interfaceCloseable- Specified by:
 closein interfaceMetaDataIterator
 
- 
getName
public String getName()
Description copied from interface:MetaDataFilter.ResourceThe name of the resource.- Specified by:
 getNamein interfaceMetaDataFilter.Resource
 
- 
getContent
public byte[] getContent() throws IOExceptionDescription copied from interface:MetaDataFilter.ResourceResource content.- Specified by:
 getContentin interfaceMetaDataFilter.Resource- Throws:
 IOException
 
 - 
 
 -