add File.resolveAsChild

This commit is contained in:
Reinhard Pointner 2015-12-11 22:28:34 +00:00
parent 7ea5b88011
commit b87e662466
1 changed files with 4 additions and 0 deletions

View File

@ -56,6 +56,10 @@ public class ScriptShellMethods {
return new File(self.getParentFile(), name); return new File(self.getParentFile(), name);
} }
public static File resolveAsChild(File self, File folder) {
return self.isAbsolute() ? self : new File(folder, self.getPath());
}
public static List<File> listFiles(File self, Closure<?> closure) { public static List<File> listFiles(File self, Closure<?> closure) {
return DefaultGroovyMethods.findAll(FileUtilities.getChildren(self), closure); return DefaultGroovyMethods.findAll(FileUtilities.getChildren(self), closure);
} }