org.apache.openjpa.lib.meta
Class JarFileURLMetaDataIterator

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

public class JarFileURLMetaDataIterator
extends Object
implements MetaDataIterator, MetaDataFilter.Resource

Iterator over all metadata resources in a given resource addressed by a jar:file URL.


Constructor Summary
JarFileURLMetaDataIterator(URL url, MetaDataFilter 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

JarFileURLMetaDataIterator

public JarFileURLMetaDataIterator(URL url,
                                  MetaDataFilter filter)
                           throws IOException
Throws:
IOException
Method Detail

hasNext

public boolean hasNext()
                throws IOException
Return whether there is another resource to iterate over.

Specified by:
hasNext in interface MetaDataIterator
Throws:
IOException

next

public Object next()
            throws IOException
Return the next metadata resource.

Specified by:
next in interface MetaDataIterator
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Return the last-iterated metadata resource content as a stream.

Specified by:
getInputStream in interface MetaDataIterator
Throws:
IOException

getFile

public File getFile()
             throws IOException
Return the last-iterated metadata resource content as a file, or null if not an extant file.

Specified by:
getFile in interface MetaDataIterator
Throws:
IOException

close

public void close()
Close the resources used by this iterator.

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

getName

public String getName()
The name of the resource.

Specified by:
getName in interface MetaDataFilter.Resource

getContent

public byte[] getContent()
                  throws IOException
Resource content.

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


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