- public static void createPrivateDirectories(String path) throws IOException {
- final Path file = new File(path).toPath();
+ public static byte[] readFully(InputStream in) throws IOException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ Util.copy(in, baos);
+ return baos.toByteArray();
+ }
+
+ public static void createPrivateDirectories(String directoryPath) throws IOException {
+ final File file = new File(directoryPath);
+ if (file.exists()) {
+ return;
+ }
+
+ final Path path = file.toPath();