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 boolean
hasContextRoot(File archive)
Tests whetherarchive
has context root.static boolean
hasJavaArchiveExtension(String fileName, boolean processEar)
Tests whether a file name has the Java archive extension.static boolean
hasWebArchiveExtension(String fileName)
Tests whether a file name has the Web archive extension.static boolean
hasWebInf(File archive)
Tests whetherarchive
containsWEB-INF
subdirectory.static String
removeJavaArchiveExtension(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:
true
if the file name is notnull
and has Java archive extension;false
otherwise.
-
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:
true
if the file name has Web archive extension;false
otherwise.
-
hasWebInf
public static boolean hasWebInf(File archive)
Tests whetherarchive
containsWEB-INF
subdirectory.- Parameters:
archive
- the archive to test.- Returns:
true
if the archive containsWEB-INF
subdirectory;false
otherwise.
-
hasContextRoot
public static boolean hasContextRoot(File archive)
Tests whetherarchive
has context root. Note: now tests only Web archives.- Parameters:
archive
- the archive to test.- Returns:
true
if the archive has context root;false
otherwise.
-
-