Package com.powsybl.afs.storage
Class Utils
- java.lang.Object
-
- com.powsybl.afs.storage.Utils
-
public final class Utils extends Object
Utility class.- Author:
- Valentin Berthault
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkDiskSpace(Path dir)
Check that there is enough space on the diskstatic void
deleteDirectory(Path directoryToBeDeleted)
delete directorystatic void
unzip(Path zipPath, Path nodeDir)
unzipstatic void
zip(Path dir, Path zipPath, boolean deleteDirectory)
zip a directory
-
-
-
Method Detail
-
zip
public static void zip(Path dir, Path zipPath, boolean deleteDirectory) throws IOException
zip a directory- Parameters:
dir
- directory path to zipzipPath
- path to the zip to create- Throws:
IllegalArgumentException
- IllegalArgumentExceptionIOException
-
checkDiskSpace
public static void checkDiskSpace(Path dir) throws IOException
Check that there is enough space on the disk- Parameters:
dir
- directory to save- Throws:
IOException
- IOException
-
unzip
public static void unzip(Path zipPath, Path nodeDir) throws IOException
unzip- Parameters:
zipPath
- zip PathnodeDir
- path to the directory where unzip- Throws:
IOException
-
deleteDirectory
public static void deleteDirectory(Path directoryToBeDeleted) throws IOException
delete directory- Parameters:
directoryToBeDeleted
- directory to be deleted- Throws:
IOException
-
-