@Test public void testPutBytes() throws Exception { byte[] data = new byte[] { 1, 2, 3 }; String key = storage.put(data); Path blobPath = dataDirectory.resolve("blobs").resolve(key); assertTrue("Blob file " + blobPath + " does not exist", Files.exists(blobPath)) ; byte[] actualData = Files.readAllBytes(blobPath); assertThat(actualData, is(data)); }
@Override public String put(byte[] data) throws IOException { Files.createDirectories(getRoot()); String key = createNewKey(); Files.write(getFileName(key), data); return key; }
FileBasedBlobStorage implements BlobStorage { @Override public String put(byte[] data) throws IOException { Files.createDirectories(getRoot()); String key = createNewKey(); Files.write(getFileName(key), data); return key; } }
FileBasedBlobStorage implements BlobStorage { @Override public String put(byte[] data) throws IOException { Files.createDirectories(getRoot()); String key = createNewKey(); Files.write(getFileName(key), data); return key; }  }
FileBasedBlobStorage implements BlobStorage { @Override public String put(byte[] data) throws IOException { Files.createDirectories(getRoot()); String key = createNewKey(); Files.write(getFileName(key), data); return key; }  @Override String put(byte[] data); @Override byte[] getBytes(String key); @Override void delete(String key); }
FileBasedBlobStorage implements BlobStorage { @Override public String put(byte[] data) throws IOException { Files.createDirectories(getRoot()); String key = createNewKey(); Files.write(getFileName(key), data); return key; }  @Override String put(byte[] data); @Override byte[] getBytes(String key); @Override void delete(String key);  }