Class FileUtils

java.lang.Object
co.com.bancolombia.utils.FileUtils

public class FileUtils extends Object
  • Constructor Details

    • FileUtils

      public FileUtils()
  • Method Details

    • resolveFile

      public static File resolveFile(File projectDir, String filePath)
    • 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

      public static void writeContentToFile(String content, File file) throws IOException
      Throws:
      IOException
    • readFile

      public static String readFile(org.gradle.api.Project project, String filePath) throws IOException
      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

      public static List<File> finderSubProjects(String dirPath)
    • readProperties

      public static String readProperties(String variable) throws IOException
      Throws:
      IOException
    • readProperties

      public static String readProperties(String projectPath, String variable) throws IOException
      Throws:
      IOException
    • readBooleanProperty

      public static boolean readBooleanProperty(String variable)
    • 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

      public static tools.jackson.databind.node.ObjectNode getFromYaml(File file)
    • parseToYaml

      public static String parseToYaml(tools.jackson.databind.node.ObjectNode node)
    • exists

      public static boolean exists(String dir, String file)
    • toRelative

      public static String toRelative(String path)
    • allFiles

      public static void allFiles(File root, Consumer<File> handler)
    • allFiles

      public static void allFiles(File root, Consumer<File> handler, FilenameFilter filter)
    • readFileFromZip

      public static String readFileFromZip(Path zip, String file) throws IOException
      Throws:
      IOException
    • deleteFileOrDir

      public static void deleteFileOrDir(File projectDir, String path, org.gradle.api.logging.Logger logger)
    • deleteDirectory

      public static void deleteDirectory(File dir, String path, org.gradle.api.logging.Logger logger)
    • deleteFile

      public static void deleteFile(File file, String path, org.gradle.api.logging.Logger logger)
    • getOrCreateNode

      public static tools.jackson.databind.node.ObjectNode getOrCreateNode(tools.jackson.databind.node.ObjectNode node, List<String> attributes)
    • 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

      public static String buildFromTemplate(String resource, Map<String,Object> params, com.github.mustachejava.MustacheFactory mustacheFactory)
    • buildFromTemplate

      public static String buildFromTemplate(String resource, Map<String,Object> params)
    • getBooleanProperty

      public static boolean getBooleanProperty(String projectPath, String property, boolean defaultValue, org.gradle.api.logging.Logger logger)