org.objectweb.jonas_lib.deployment.work
Class FileManager

java.lang.Object
  extended by org.objectweb.jonas_lib.deployment.work.FileManager
Direct Known Subclasses:
EarFileManager

public class FileManager
extends java.lang.Object

JOnAS File manager.
This class provides a way for managing the working package files.

Author:
Florent Benoit

Constructor Summary
protected FileManager()
          Constructor.
 
Method Summary
protected static void dump(java.io.InputStream in, java.io.File earEntryFile)
          Write an input stream to a given file.
static java.lang.String fileToTimeStampDir(java.net.URL urlFileName)
          Give the unpack destination directory of the specified file.
static java.lang.String fileToTimeStampDir(java.net.URL urlFileName, java.lang.String ext)
          Give the unpack destination directory of the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManager

protected FileManager()
Constructor. Private as it is an utility class

Method Detail

fileToTimeStampDir

public static java.lang.String fileToTimeStampDir(java.net.URL urlFileName)
                                           throws FileManagerException
Give the unpack destination directory of the specified file.

Parameters:
urlFileName - the url of the name of the EAR file (ends with the .ear extension).
Returns:
the timestamp destination directory of the specified file.
Throws:
FileManagerException - if we can't get the timestamp.

fileToTimeStampDir

public static java.lang.String fileToTimeStampDir(java.net.URL urlFileName,
                                                  java.lang.String ext)
                                           throws FileManagerException
Give the unpack destination directory of the specified file.

Parameters:
urlFileName - the url of the name of the EAR file (ends with the .ear extension).
ext - the suffix to concatenate to the build name
Returns:
the timestamp destination directory of the specified file.
Throws:
FileManagerException - if we can't get the timestamp.

dump

protected static void dump(java.io.InputStream in,
                           java.io.File earEntryFile)
                    throws FileManagerException
Write an input stream to a given file.

Parameters:
in - the inputStream.
earEntryFile - the file where the inputstream must be dumped.
Throws:
FileManagerException - if the dump failed.