Package org.nuiton.jaxx.runtime.util
Class FileUtil
- java.lang.Object
-
- org.nuiton.jaxx.runtime.util.FileUtil
-
public class FileUtil extends Object
Created by tchemit on 12/07/17.- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFileUtil.FileAction
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FilegetFileFromFQN(File rootDirectory, String fqn)Obtain a file fro the givenrootDirectory, applying the fqn.static FilegetFileFromPaths(File rootDirectory, String... paths)Obtain a file from the givenrootDirectory, applying given paths.static booleanwalkAfter(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.
-
-
-
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 commencerfileAction- 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 givenrootDirectory, applying given paths.For example with paths = a, b and c, then result is :
root/a/b/c
- Parameters:
rootDirectory- the root directorypaths- paths to apply- Returns:
- the final file
- Since:
- 2.2
-
getFileFromFQN
public static File getFileFromFQN(File rootDirectory, String fqn)
Obtain a file fro the givenrootDirectory, applying the fqn.For example with fqn = a.b.c, the result is :
root/a/b/c
- Parameters:
rootDirectory- the root directoryfqn- fqn of searched file- Returns:
- the final file
- Since:
- 2.2
-
-