Package co.com.bancolombia.utils
Class FileUtils
java.lang.Object
co.com.bancolombia.utils.FileUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidallFiles(File root, Consumer<File> handler, FilenameFilter filter) static StringbuildFromTemplate(String resource, Map<String, Object> params) static StringbuildFromTemplate(String resource, Map<String, Object> params, com.github.mustachejava.MustacheFactory mustacheFactory) static voiddeleteDirectory(File dir, String path, org.gradle.api.logging.Logger logger) static voiddeleteFile(File file, String path, org.gradle.api.logging.Logger logger) static voiddeleteFileOrDir(File projectDir, String path, org.gradle.api.logging.Logger logger) static booleanfinderSubProjects(String dirPath) static booleangetBooleanProperty(String projectPath, String property, boolean defaultValue, org.gradle.api.logging.Logger logger) static tools.jackson.databind.node.ObjectNodegetFromYaml(File file) static tools.jackson.databind.node.ObjectNodegetOrCreateNode(tools.jackson.databind.node.ObjectNode node, List<String> attributes) static StringgetResourceAsString(com.github.mustachejava.resolver.DefaultResolver resolver, String path) static <T> TloadTemplateDefinition(com.github.mustachejava.resolver.DefaultResolver resolver, tools.jackson.databind.ObjectMapper mapper, String resourceGroup, String definitionFile, Class<T> type) static StringparseToYaml(tools.jackson.databind.node.ObjectNode node) static booleanreadBooleanProperty(String variable) static Stringstatic Stringstatic StringreadFileAsString(File file, org.gradle.api.logging.Logger logger) static StringreadFileFromZip(Path zip, String file) static StringreadProperties(String variable) static StringreadProperties(String projectPath, String variable) static FileresolveFile(File projectDir, String filePath) static voidsetGradleProperty(String projectPath, String variable, String value) static StringtoRelative(String path) static voidwriteContentToFile(String content, File file) static voidwriteString(File projectDir, String filePath, String content, org.gradle.api.logging.Logger logger) static voidwriteString(org.gradle.api.Project project, String filePath, String content)
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
resolveFile
-
writeString
public static void writeString(org.gradle.api.Project project, String filePath, String content) throws IOException - Throws:
IOException
-
writeString
public static void writeString(File projectDir, String filePath, String content, org.gradle.api.logging.Logger logger) throws IOException - Throws:
IOException
-
writeContentToFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readFile
public static String readFile(File projectDir, String filePath, org.gradle.api.logging.Logger logger) throws IOException - Throws:
IOException
-
readFileAsString
public static String readFileAsString(File file, org.gradle.api.logging.Logger logger) throws IOException - Throws:
IOException
-
finderSubProjects
-
readProperties
- Throws:
IOException
-
readProperties
- Throws:
IOException
-
readBooleanProperty
-
setGradleProperty
public static void setGradleProperty(String projectPath, String variable, String value) throws IOException - Throws:
IOException
-
getResourceAsString
public static String getResourceAsString(com.github.mustachejava.resolver.DefaultResolver resolver, String path) throws IOException - Throws:
IOException
-
getFromYaml
-
parseToYaml
-
exists
-
toRelative
-
allFiles
-
allFiles
-
readFileFromZip
- Throws:
IOException
-
deleteFileOrDir
-
deleteDirectory
-
deleteFile
-
getOrCreateNode
-
loadTemplateDefinition
public static <T> T loadTemplateDefinition(com.github.mustachejava.resolver.DefaultResolver resolver, tools.jackson.databind.ObjectMapper mapper, String resourceGroup, String definitionFile, Class<T> type) throws IOException - Throws:
IOException
-
buildFromTemplate
-
buildFromTemplate
-
getBooleanProperty
-