com.zeroturnaround.liverebel.util
Class LiveApplicationUtil

java.lang.Object
  extended by com.zeroturnaround.liverebel.util.LiveApplicationUtil

public class LiveApplicationUtil
extends Object

Generic utilities for LiveRebel applications.

Author:
Rein Raudjärv
See Also:
LiveRebelXml

Field Summary
static String TYPE_EAR
           
static String TYPE_JAR
           
static String TYPE_WAR
           
static String WEB_INF_CLASSES_PREFIX
           
 
Constructor Summary
LiveApplicationUtil()
           
 
Method Summary
static String findApplicationType(File application)
          Detects the application type.
static Set findEarModulePaths(File application)
          Finds the module paths of an EAR.
static LiveRebelXml findLiveRebelXml(File application)
          Finds and parses a liverebel.xml of the given application.
static LiveRebelXml findLiveRebelXml(ZipInputStream applicationAsStream)
          Finds and parses a liverebel.xml of the given application.
static byte[] findLiveRebelXmlContents(File application)
          Finds the liverebel.xml contents in the given application.
static byte[] findLiveRebelXmlContents(ZipInputStream applicationAsStream)
          Finds the liverebel.xml contents in the given application.
static String getDefaultContextPath(String appId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_JAR

public static final String TYPE_JAR
See Also:
Constant Field Values

TYPE_WAR

public static final String TYPE_WAR
See Also:
Constant Field Values

TYPE_EAR

public static final String TYPE_EAR
See Also:
Constant Field Values

WEB_INF_CLASSES_PREFIX

public static final String WEB_INF_CLASSES_PREFIX
See Also:
Constant Field Values
Constructor Detail

LiveApplicationUtil

public LiveApplicationUtil()
Method Detail

findApplicationType

public static String findApplicationType(File application)
Detects the application type.

Parameters:
application - EAR, WAR or JAR file/directory (not null).
Returns:
either EAR, WAR or JAR.

findEarModulePaths

public static Set findEarModulePaths(File application)
Finds the module paths of an EAR.

Parameters:
application - EAR directory or file.
Returns:
module paths of this EAR.

findLiveRebelXml

public static LiveRebelXml findLiveRebelXml(File application)
Finds and parses a liverebel.xml of the given application.

Parameters:
application - EAR, WAR or JAR file/directory.
Returns:
liverebel.xml of this application or null if no liverebel.xml was found.

findLiveRebelXml

public static LiveRebelXml findLiveRebelXml(ZipInputStream applicationAsStream)
Finds and parses a liverebel.xml of the given application.

Parameters:
applicationAsStream - ZipInputStream from EAR, WAR or JAR file.
Returns:
liverebel.xml of this application or null if no liverebel.xml was found.

findLiveRebelXmlContents

public static byte[] findLiveRebelXmlContents(File application)
Finds the liverebel.xml contents in the given application.

Parameters:
application - EAR, WAR or JAR file/directory.
Returns:
liverebel.xml contents of this application or null if nothing found.

findLiveRebelXmlContents

public static byte[] findLiveRebelXmlContents(ZipInputStream applicationAsStream)
Finds the liverebel.xml contents in the given application.

Parameters:
applicationAsStream - ZipInputStream from EAR, WAR or JAR file.
Returns:
liverebel.xml contents of this application or null if nothing found.

getDefaultContextPath

public static String getDefaultContextPath(String appId)


Copyright © 2012. All Rights Reserved.