org.objectweb.jonas_lib.deployment.work
Class EarFileManager

java.lang.Object
  extended by org.objectweb.jonas_lib.deployment.work.FileManager
      extended by org.objectweb.jonas_lib.deployment.work.EarFileManager

public class EarFileManager
extends FileManager

JOnAS Ear File manager. This class provides a way for managing the EAR files.

Author:
Florent Benoit, Ludovic Bert, Nicolas Van Caneghem Allow the deployment of an exploded ear

Method Summary
protected static boolean isUnpackedEar(java.net.URL urlFileName, java.net.URL urlDirName)
          true If an unpacked directory has the same timestamp than the EAR file, false otherwise.
static java.net.URL unpackEar(java.net.URL urlFileName, java.net.URL urlDirName)
          Unpack the given EAR file to the specified directory.
static java.net.URL unpackEar(java.net.URL urlFileName, java.net.URL urlDirName, boolean useTimeStamp)
          Unpack the given EAR file to the specified directory.
 
Methods inherited from class org.objectweb.jonas_lib.deployment.work.FileManager
dump, fileToTimeStampDir, fileToTimeStampDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isUnpackedEar

protected static boolean isUnpackedEar(java.net.URL urlFileName,
                                       java.net.URL urlDirName)
                                throws FileManagerException
true If an unpacked directory has the same timestamp than the EAR file, false otherwise.

Parameters:
urlFileName - the url of the name of the EAR file (ends with the .ear extension).
urlDirName - the url of the directory where the file must be unpacked.
Returns:
true If an unpacked directory has the same timestamp than the EAR file, false otherwise.
Throws:
FileManagerException - if the file doesn't exist

unpackEar

public static java.net.URL unpackEar(java.net.URL urlFileName,
                                     java.net.URL urlDirName)
                              throws FileManagerException
Unpack the given EAR file to the specified directory.

Parameters:
urlFileName - the url of the name of the EAR file to unpack.
urlDirName - the url of the destination directory where is unpacked the EAR file.
Returns:
the url of the unpacked directory
Throws:
FileManagerException - if we can't unpack the file.

unpackEar

public static java.net.URL unpackEar(java.net.URL urlFileName,
                                     java.net.URL urlDirName,
                                     boolean useTimeStamp)
                              throws FileManagerException
Unpack the given EAR file to the specified directory.

Parameters:
urlFileName - the url of the name of the EAR file to unpack.
urlDirName - the url of the destination directory where is unpacked the EAR file.
useTimeStamp - use timestamping for unpacking the EAR or not
Returns:
the url of the unpacked directory
Throws:
FileManagerException - if we can't unpack the file.