Add File.getDisplaySize() extension method

This commit is contained in:
Reinhard Pointner 2019-05-20 00:28:21 +07:00
parent 9c21465e50
commit 6fb43e79b7
1 changed files with 4 additions and 0 deletions

View File

@ -262,6 +262,10 @@ public class ScriptShellMethods {
return FileUtilities.copyAs(self, new File(destination, self.getName()));
}
public String getDisplaySize(File self) {
return FileUtilities.formatSize(self.length());
}
public static void createIfNotExists(File self) throws IOException {
if (!self.isFile()) {
// create parent folder structure if necessary & create file