- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 35 of file Files.java.
◆ exists()
static boolean org.turro.elephant.impl.util.Files.exists |
( |
String |
path | ) |
|
|
static |
Definition at line 80 of file Files.java.
81 path = ElephantContext.getRealPath(path);
82 return path ==
null ? false :
new File(path).exists();
◆ file() [1/2]
static File org.turro.elephant.impl.util.Files.file |
( |
IConstructor |
constructor, |
|
|
String |
file |
|
) |
| |
|
static |
Definition at line 71 of file Files.java.
72 return file(
file.replaceAll(
"\\*", constructor.getRenderingContext().getPath() +
"/_internal/repository"));
static File file(IConstructor constructor, String file)
◆ file() [2/2]
static File org.turro.elephant.impl.util.Files.file |
( |
String |
file | ) |
|
|
static |
◆ getFiles()
static List<String> org.turro.elephant.impl.util.Files.getFiles |
( |
final String |
path, |
|
|
final String |
pattern |
|
) |
| |
|
static |
Definition at line 53 of file Files.java.
54 ArrayList<String> files =
new ArrayList<>();
55 File folder =
new File(ElephantContext.getRealPath(path));
57 for(File
file : folder.listFiles(
new FilenameFilter() {
59 public boolean accept(File dir, String name) {
60 return name.matches(Strings.convertToRegEx(pattern));
64 files.add(ElephantContext.getRootWebPath() + path +
"/" +
file.getName());
◆ getJsonFiles()
static String org.turro.elephant.impl.util.Files.getJsonFiles |
( |
final String |
path, |
|
|
final String |
pattern |
|
) |
| |
|
static |
Definition at line 37 of file Files.java.
38 return new Gson().toJson(
getFiles(path, pattern));
static List< String > getFiles(final String path, final String pattern)
◆ getJsonShuffledFiles()
static String org.turro.elephant.impl.util.Files.getJsonShuffledFiles |
( |
final String |
path, |
|
|
final String |
pattern |
|
) |
| |
|
static |
Definition at line 47 of file Files.java.
48 List<String> files =
getFiles(path, pattern);
49 Collections.shuffle(files);
50 return new Gson().toJson(files);
◆ getJsonSortedFiles()
static String org.turro.elephant.impl.util.Files.getJsonSortedFiles |
( |
final String |
path, |
|
|
final String |
pattern |
|
) |
| |
|
static |
Definition at line 41 of file Files.java.
42 List<String> files =
getFiles(path, pattern);
43 Collections.sort(files);
44 return new Gson().toJson(files);
◆ toExisting()
static String org.turro.elephant.impl.util.Files.toExisting |
( |
String |
path | ) |
|
|
static |
Definition at line 85 of file Files.java.
87 int p = path.lastIndexOf(
"/");
89 path = path.substring(0, p);
static boolean exists(String path)
The documentation for this class was generated from the following file: