Class IO
- java.lang.Object
-
- app.coronawarn.server.services.distribution.assembly.io.IO
-
public class IO extends Object
A class containing helper functions for general purpose file IO.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAXIMUM_FILE_SIZE
The maximum acceptable file size in bytes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
makeNewFile(File root, String name)
Create a file on the disk if it does not already exist.static void
writeBytesToFile(byte[] bytes, File outputFile)
Writes bytes into a file.
-
-
-
Field Detail
-
MAXIMUM_FILE_SIZE
public static final int MAXIMUM_FILE_SIZE
The maximum acceptable file size in bytes.- See Also:
- Constant Field Values
-
-
Method Detail
-
makeNewFile
public static void makeNewFile(File root, String name)
Create a file on the disk if it does not already exist.- Parameters:
root
- The parent file.name
- The name of the new file.
-
writeBytesToFile
public static void writeBytesToFile(byte[] bytes, File outputFile)
Writes bytes into a file. If the resulting file would exceed the specified maximum file size, it is not written but removed instead.- Parameters:
bytes
- The content to writeoutputFile
- The file to write the content into.
-
-