org.ow2.util.ee.deploy.impl.archive
Class JarArchiveImpl

java.lang.Object
  extended by org.ow2.util.ee.deploy.impl.archive.JarArchiveImpl
All Implemented Interfaces:
org.ow2.util.ee.deploy.api.archive.IArchive

public class JarArchiveImpl
extends java.lang.Object
implements org.ow2.util.ee.deploy.api.archive.IArchive

Creates wrapper around jar file.

Author:
Florent Benoit

Constructor Summary
protected JarArchiveImpl(java.io.File file)
          Creates new instance of an EZBArchive for a jar file.
 
Method Summary
 boolean close()
          Close the underlying Resource.
 boolean equals(java.lang.Object o)
          Is that the given object is equals to our instance.
 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()
           
 int hashCode()
          Gets hashcode for this object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JarArchiveImpl

protected JarArchiveImpl(java.io.File file)
Creates new instance of an EZBArchive for a jar file.

Parameters:
file - the given jar file.
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface org.ow2.util.ee.deploy.api.archive.IArchive
Returns:
a description of this archive. This name could be used in logger info.

close

public boolean close()
Close the underlying Resource.

Specified by:
close in interface org.ow2.util.ee.deploy.api.archive.IArchive
Returns:
Returns true if the close was succesful, false otherwise.

getResource

public java.net.URL getResource(java.lang.String resourceName)
                         throws org.ow2.util.ee.deploy.api.archive.ArchiveException
Specified by:
getResource in interface org.ow2.util.ee.deploy.api.archive.IArchive
Parameters:
resourceName - The resource name to be looked up.
Returns:
Returns the resource URL if the resource has been found. null otherwise.
Throws:
org.ow2.util.ee.deploy.api.archive.ArchiveException - if method fails.

getResources

public java.util.Iterator<java.net.URL> getResources()
                                              throws org.ow2.util.ee.deploy.api.archive.ArchiveException
Specified by:
getResources in interface org.ow2.util.ee.deploy.api.archive.IArchive
Returns:
Returns an Iterator of Resource's URL.
Throws:
org.ow2.util.ee.deploy.api.archive.ArchiveException - if method fails.

getResources

public java.util.Iterator<java.net.URL> getResources(java.lang.String resourceName)
                                              throws org.ow2.util.ee.deploy.api.archive.ArchiveException
Specified by:
getResources in interface org.ow2.util.ee.deploy.api.archive.IArchive
Parameters:
resourceName - The resource name to be looked up.
Returns:
Returns an Iterator of matching resources.
Throws:
org.ow2.util.ee.deploy.api.archive.ArchiveException - if method fails.

getURL

public java.net.URL getURL()
                    throws org.ow2.util.ee.deploy.api.archive.ArchiveException
Specified by:
getURL in interface org.ow2.util.ee.deploy.api.archive.IArchive
Returns:
Returns the resource URL.
Throws:
org.ow2.util.ee.deploy.api.archive.ArchiveException - if method fails.

equals

public boolean equals(java.lang.Object o)
Is that the given object is equals to our instance.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare.
Returns:
true if equals, else false.

hashCode

public int hashCode()
Gets hashcode for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation


Copyright © 2007 OW2 Consortium. All Rights Reserved.