import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import java.util.stream.Collectors;
public class FileUtils
{
public static List<File> getFilesFromGlob(String pattern)
{
List<File> files = new ArrayList<>();
-
/*
* For efficiency of the Files.walkFileTree, let's find the longest path that doesn't need globbing.
* We look for the first glob character * { ? and then look for the last File.separator before that.
return files;
}
+
+ public static List<String> getFilenamesFromGlob(String pattern)
+ {
+ // convert list of Files to list of File.getPath() Strings
+ return getFilesFromGlob(pattern).stream().map(f -> f.getPath())
+ .collect(Collectors.toList());
+ }
+
}
\ No newline at end of file