add File.resolveAsChild
This commit is contained in:
parent
7ea5b88011
commit
b87e662466
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue