public class ArchetypeUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
static String[] |
sourceCodeDirNames |
| Constructor and Description |
|---|
ArchetypeUtils() |
| Modifier and Type | Method and Description |
|---|---|
File |
findRootPackage(File directory)
Recursively looks for first nested directory which contains at least one source file
|
String |
firstElementText(Element root,
String elementName,
String defaultValue) |
static boolean |
isEmpty(String s) |
boolean |
isValidFileToCopy(File projectDir,
File src)
Is the file a valid file to copy (excludes files starting with a dot, build output
or java/groovy/kotlin/scala source code
|
boolean |
isValidProjectPom(File pom)
Checks if the passed POM file describes project with packaging other than
pom. |
boolean |
isValidSourceFileOrDir(File file)
Returns true if this file is a valid source file; so
excluding things like .svn directories and whatnot
|
Document |
parseXml(InputSource inputSource) |
String |
relativePath(File base,
File nested)
Returns relative path (without leading '/') if
nested is inside base. |
static void |
writeFile(File file,
String data,
boolean append) |
static void |
writeGitIgnore(File gitIgnore) |
void |
writeXmlDocument(Document document,
File file)
Serializes the Document to a File.
|
public static org.slf4j.Logger LOG
public static final String[] sourceCodeDirNames
public String relativePath(File base, File nested) throws IOException
nested is inside base.
Returns nested (as absolute path) otherwise.base - nested - IOExceptionpublic File findRootPackage(File directory) throws IOException
directory - IOExceptionpublic boolean isValidSourceFileOrDir(File file)
public boolean isValidFileToCopy(File projectDir, File src) throws IOException
IOExceptionpublic boolean isValidProjectPom(File pom)
pom.pom - public Document parseXml(InputSource inputSource)
public void writeXmlDocument(Document document, File file) throws IOException
document - file - IOExceptionpublic String firstElementText(Element root, String elementName, String defaultValue)
public static void writeGitIgnore(File gitIgnore)
public static boolean isEmpty(String s)
Copyright © 2011–2014 Red Hat. All rights reserved.