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) |
protected boolean |
isExcludedDotFile(String name)
Lets allow files like .maven-docker-include or .gitignore but lets ignore other files starting with "."
|
boolean |
isValidFileToCopy(File projectDir,
File src,
Set<String> ignoreFileSet)
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.
|
String |
writeXmlDocumentAsString(Document document)
Serializes the Document to a String.
|
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
- IOException
public File findRootPackage(File directory) throws IOException
directory
- IOException
public boolean isValidSourceFileOrDir(File file)
protected boolean isExcludedDotFile(String name)
public boolean isValidFileToCopy(File projectDir, File src, Set<String> ignoreFileSet) throws IOException
IOException
public boolean isValidProjectPom(File pom)
pom
.pom
- public Document parseXml(InputSource inputSource)
public void writeXmlDocument(Document document, File file) throws IOException
IOException
public String writeXmlDocumentAsString(Document document) throws IOException
IOException
public String firstElementText(Element root, String elementName, String defaultValue)
public static void writeGitIgnore(File gitIgnore)
public static boolean isEmpty(String s)
Copyright © 2014–2017 Red Hat. All rights reserved.