Package fish.payara.deployment.util
Class JavaArchiveUtils
- java.lang.Object
-
- fish.payara.deployment.util.JavaArchiveUtils
-
public final class JavaArchiveUtils extends Object
General Java Archive manipulation utilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasContextRoot(File archive)Tests whetherarchivehas context root.static booleanhasJavaArchiveExtension(String fileName, boolean processEar)Tests whether a file name has the Java archive extension.static booleanhasWebArchiveExtension(String fileName)Tests whether a file name has the Web archive extension.static booleanhasWebInf(File archive)Tests whetherarchivecontainsWEB-INFsubdirectory.static StringremoveJavaArchiveExtension(String fileName, boolean processEar)Removes the Java archive extension from the file name.
-
-
-
Method Detail
-
hasJavaArchiveExtension
public static boolean hasJavaArchiveExtension(String fileName, boolean processEar)
Tests whether a file name has the Java archive extension.- Parameters:
fileName- the file name to test.processEar- iftrue, tests the EAR extension.- Returns:
trueif the file name is notnulland has Java archive extension;falseotherwise.
-
removeJavaArchiveExtension
public static String removeJavaArchiveExtension(String fileName, boolean processEar)
Removes the Java archive extension from the file name.- Parameters:
fileName- the file name.processEar- iftrue, removes the EAR extension.- Returns:
- The file name without extension.
-
hasWebArchiveExtension
public static boolean hasWebArchiveExtension(String fileName)
Tests whether a file name has the Web archive extension.- Parameters:
fileName- the file name to test.- Returns:
trueif the file name has Web archive extension;falseotherwise.
-
hasWebInf
public static boolean hasWebInf(File archive)
Tests whetherarchivecontainsWEB-INFsubdirectory.- Parameters:
archive- the archive to test.- Returns:
trueif the archive containsWEB-INFsubdirectory;falseotherwise.
-
hasContextRoot
public static boolean hasContextRoot(File archive)
Tests whetherarchivehas context root. Note: now tests only Web archives.- Parameters:
archive- the archive to test.- Returns:
trueif the archive has context root;falseotherwise.
-
-