Class FileUtil


  • public class FileUtil
    extends Object
    Created by tchemit on 12/07/17.
    Author:
    Tony Chemit - dev@tchemit.fr
    • Constructor Detail

      • FileUtil

        public FileUtil()
    • Method Detail

      • walkAfter

        public static boolean walkAfter​(File f,
                                        FileUtil.FileAction fileAction)
        Permet de faire une action avant le parcours des fichiers, c-a-d que l'on fera l'action sur les fichiers contenu dans un répertoire après l'action sur le répertoire lui même.
        Parameters:
        f - le fichier ou répertoire à partir duquel il faut commencer
        fileAction - l'action à effectuer sur chaque fichier
        Returns:
        le résultat des fileAction executé sur les fichiers, chaque résultat de FileAction sont assemblé par un ET logique pour donner le résultat final
      • getFileFromPaths

        public static File getFileFromPaths​(File rootDirectory,
                                            String... paths)
        Obtain a file from the given rootDirectory, applying given paths.

        For example with paths = a, b and c, then result is :

         root/a/b/c
         
        Parameters:
        rootDirectory - the root directory
        paths - paths to apply
        Returns:
        the final file
        Since:
        2.2
      • getFileFromFQN

        public static File getFileFromFQN​(File rootDirectory,
                                          String fqn)
        Obtain a file fro the given rootDirectory, applying the fqn.

        For example with fqn = a.b.c, the result is :

         root/a/b/c
         
        Parameters:
        rootDirectory - the root directory
        fqn - fqn of searched file
        Returns:
        the final file
        Since:
        2.2