Class FileUtils

java.lang.Object
org.frankframework.util.FileUtils

public class FileUtils extends Object
Utilities for batch file handling.
Author:
John Dekker
  • Constructor Details

    • FileUtils

      public FileUtils()
  • Method Details

    • getFilename

      public static String getFilename(ParameterList definedParameters, PipeLineSession session, File originalFile, String filenamePattern) throws ParameterException
      Throws:
      ParameterException
    • moveFile

      public static String moveFile(File orgFile, File rename2File, boolean overwrite, int numBackups, int numberOfAttempts, long waitTime) throws InterruptedException, IOException
      Throws:
      InterruptedException
      IOException
    • moveFile

      public static String moveFile(File orgFile, File rename2File, int numberOfAttempts, long waitTime) throws InterruptedException
      Throws:
      InterruptedException
    • getFreeFile

      public static File getFreeFile(File file)
    • copyFile

      public static boolean copyFile(File orgFile, File destFile, boolean append)
    • createTempFile

      public static File createTempFile() throws IOException
      Creates a temporary file inside the ${ibis.tmpdir} using the default '.tmp' extension.
      Throws:
      IOException
    • createTempFile

      public static File createTempFile(String extension) throws IOException
      Creates a temporary file inside the ${ibis.tmpdir} using the specified extension.
      Throws:
      IOException
    • getTempDirectory

      @Nonnull public static String getTempDirectory()
      If the ${ibis.tmpdir} is relative it will turn it into an absolute path
      Returns:
      The absolute path of ${ibis.tmpdir} or IOException if it cannot be resolved
    • getTempDirectory

      public static File getTempDirectory(String folder) throws IOException
      Returns:
      the ${ibis.tmpdir}/folder or IOException if it cannot be resolved. If the ${ibis.tmpdir} is relative it will turn it into an absolute path
      Throws:
      IOException
    • makeBackups

      protected static void makeBackups(File targetFile, int numBackups)
    • getFiles

      public static File[] getFiles(String directory, String wildcard, String excludeWildcard, long minStability)
    • getFileNameExtension

      public static String getFileNameExtension(String fileName)
    • getBaseName

      public static String getBaseName(String fileName)
    • readAllowed

      public static boolean readAllowed(String rules, String fileName, FileUtils.Authenticator authenticator)