org.ow2.util.archive.api
Interface IArchive

All Known Subinterfaces:
IFileArchive

public interface IArchive

Abstraction layer around processed archive (Jar, Directories, Bundles, ...).

Author:
Guillaume Sauthier

Method Summary
 boolean close()
          Close the underlying Resource.
 java.util.Iterator<java.lang.String> getEntries()
           
 IArchiveMetadata getMetadata()
           
 java.lang.String getName()
           
 java.net.URL getResource(java.lang.String resourceName)
           
 java.util.Iterator<java.net.URL> getResources()
           
 java.util.Iterator<java.net.URL> getResources(java.lang.String resourceName)
           
 java.net.URL getURL()
          Returns an URL that can be used to access the resource described by this IArchive.
 

Method Detail

getName

java.lang.String getName()
Returns:
a description of this archive. This name could be used in logger info.

getURL

java.net.URL getURL()
                    throws ArchiveException
Returns an URL that can be used to access the resource described by this IArchive. This URL MUST be canonicalized (at least when this is a file) because it is often used as a key.

Returns:
Returns the resource URL.
Throws:
ArchiveException - if method fails.

getResource

java.net.URL getResource(java.lang.String resourceName)
                         throws ArchiveException
Parameters:
resourceName - The resource name to be looked up.
Returns:
Returns the resource URL if the resource has been found. null otherwise.
Throws:
ArchiveException - if method fails.

getResources

java.util.Iterator<java.net.URL> getResources()
                                              throws ArchiveException
Returns:
Returns an Iterator of Resource's URL.
Throws:
ArchiveException - if method fails.

getResources

java.util.Iterator<java.net.URL> getResources(java.lang.String resourceName)
                                              throws ArchiveException
Parameters:
resourceName - The resource name to be looked up.
Returns:
Returns an Iterator of matching resources.
Throws:
ArchiveException - if method fails.

getEntries

java.util.Iterator<java.lang.String> getEntries()
                                                throws ArchiveException
Returns:
Returns all resources name in the archive.
Throws:
ArchiveException - if method fails.

close

boolean close()
Close the underlying Resource.

Returns:
Returns true if the close was succesful, false otherwise.

getMetadata

IArchiveMetadata getMetadata()
Returns:
the Metadata associated to this archive.


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