Package org.guvnor.m2repo.utils
Class FileNameUtilities
- java.lang.Object
-
- org.guvnor.m2repo.utils.FileNameUtilities
-
public class FileNameUtilities extends Object
Utilities to validate file being uploaded to Guvnor's M2 Repository
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisDeployedPom(String path)Returns whether or not the provided path points to a .pom file.static booleanisJar(String fileName)Is the file a JAR file.static booleanisKJar(String fileName)Is the file a KJAR file.static booleanisPom(String fileName)Is the file a pom.xml filestatic booleanisValid(String fileName)Is the file valid; i.e. either a JAR, KJAR or pom.xml file.
-
-
-
Method Detail
-
isValid
public static boolean isValid(String fileName)
Is the file valid; i.e. either a JAR, KJAR or pom.xml file.- Parameters:
fileName-- Returns:
- true if the file is either a JAR, KJAR or pom.xml file.
-
isJar
public static boolean isJar(String fileName)
Is the file a JAR file. File names ending with ".jar" are considered valid JAR files.- Parameters:
fileName-- Returns:
- true if the file is a JAR file
-
isKJar
public static boolean isKJar(String fileName)
Is the file a KJAR file. File names ending with ".kjar" are considered valid KJAR files. It should be noted KJAR is not a recognised file extension; however it appears some Users are confusing talk of KJARS in Drools' documentation with a file extension and therefore, in the absence of any clarification from the Drools Core developers, we include such suffix. See https://bugzilla.redhat.com/show_bug.cgi?id=1201154 for examples.- Parameters:
fileName-- Returns:
- true if the file is a KJAR file
-
isPom
public static boolean isPom(String fileName)
Is the file a pom.xml file- Parameters:
fileName-- Returns:
- true if the file is a pom.xml file
-
isDeployedPom
public static boolean isDeployedPom(String path)
Returns whether or not the provided path points to a .pom file.- Parameters:
path- path to the file- Returns:
- true if the path points to a .pom file, otherwise false.
-
-