org.apache.openjpa.lib.meta
Class ZipStreamMetaDataIterator

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

public class ZipStreamMetaDataIterator
extends Object
implements MetaDataIterator, MetaDataFilter.Resource

Iterator over all metadata resources in a given zip input stream.

Author:
Abe White

Constructor Summary
ZipStreamMetaDataIterator(ZipInputStream stream, MetaDataFilter filter)
          Constructor; supply zip stream and optional metadata filter.
 
Method Summary
 void close()
          Close the resources used by this iterator.
 byte[] getContent()
          Resource content.
 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.
 String getName()
          The name of the resource.
 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

ZipStreamMetaDataIterator

public ZipStreamMetaDataIterator(ZipInputStream stream,
                                 MetaDataFilter filter)
Constructor; supply zip stream and optional metadata filter.

Method Detail

hasNext

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

Specified by:
hasNext in interface MetaDataIterator
Throws:
IOException

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()
Description copied from interface: MetaDataIterator
Return the last-iterated metadata resource content as a stream.

Specified by:
getInputStream in interface MetaDataIterator

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

getName

public String getName()
Description copied from interface: MetaDataFilter.Resource
The name of the resource.

Specified by:
getName in interface MetaDataFilter.Resource

getContent

public byte[] getContent()
                  throws IOException
Description copied from interface: MetaDataFilter.Resource
Resource content.

Specified by:
getContent in interface MetaDataFilter.Resource
Throws:
IOException


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