org.ow2.util.archive.impl
Class URLArchiveImpl

java.lang.Object
  extended by org.ow2.util.archive.impl.AbsArchiveImpl
      extended by org.ow2.util.archive.impl.URLArchiveImpl
All Implemented Interfaces:
IArchive

public class URLArchiveImpl
extends AbsArchiveImpl
implements IArchive

Implementation of an archive from an url targeting a jar.

Author:
Gael Lalire

Constructor Summary
URLArchiveImpl(URL url)
          Constructor.
 
Method Summary
 boolean close()
          Close the archive.
 Iterator<String> getEntries()
           
 String getName()
          Get archive name.
 URL getResource(String resourceName)
           
 Iterator<URL> getResources()
           
 Iterator<URL> getResources(String resourceName)
           
 URL getURL()
           
 
Methods inherited from class org.ow2.util.archive.impl.AbsArchiveImpl
getMetadata, readManifest, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.util.archive.api.IArchive
getMetadata
 

Constructor Detail

URLArchiveImpl

public URLArchiveImpl(URL url)
               throws IOException
Constructor.

Parameters:
url - the url targeting a jar
Throws:
IOException - if jar could not be read
Method Detail

close

public boolean close()
Close the archive.

Specified by:
close in interface IArchive
Returns:
true

getName

public String getName()
Get archive name.

Specified by:
getName in interface IArchive
Returns:
the url path

getResource

public URL getResource(String resourceName)
Specified by:
getResource in interface IArchive
Parameters:
resourceName - the resource name
Returns:
a resource with resourceName

getResources

public Iterator<URL> getResources()
Specified by:
getResources in interface IArchive
Returns:
all resources in jar

getResources

public Iterator<URL> getResources(String resourceName)
Specified by:
getResources in interface IArchive
Parameters:
resourceName - the resource name
Returns:
all resources with resourceName

getURL

public URL getURL()
Specified by:
getURL in interface IArchive
Returns:
the url of archive

getEntries

public Iterator<String> getEntries()
Specified by:
getEntries in interface IArchive
Returns:
all resources name


Copyright © 2007-2012 OW2 Consortium. All Rights Reserved.