Class CoreFileUtils


  • public final class CoreFileUtils
    extends Object
    Class containing utility methods.
    Since:
    0.1.0
    Author:
    nandorholozsnyak
    • Method Detail

      • initializeFileWithPath

        public static File initializeFileWithPath​(String targetFilePath)
                                           throws DocumentGenerationException
        Initialize a file and its parent directories and returns the file.
        Parameters:
        targetFilePath - target file path.
        Returns:
        the created file instance.
        Throws:
        DocumentGenerationException - if the target file or its directories can not be created.
      • initializeFileWithPath

        public static File initializeFileWithPath​(File targetFile)
                                           throws DocumentGenerationException
        Initialize a file and its parent directories and returns the file.
        Parameters:
        targetFile - target file.
        Returns:
        the created file instance.
        Throws:
        DocumentGenerationException - if the target file or its directories can not be created.
      • isJarOrZipFile

        public static boolean isJarOrZipFile​(File input)
        Checks if the input is a JAR or ZIP file based on its extension.
        Parameters:
        input - input.
        Returns:
        true if the input is a JAR or ZIP file, otherwise false.