@Override @NotNull public Blob createBlob(@NotNull InputStream inputStream) throws IOException { checkLive(); return store.createBlob(checkNotNull(inputStream)); }
@NotNull @Override public Blob createBlob(InputStream inputStream) throws IOException { return getNodeStore().createBlob(inputStream); }
@NotNull @Override public Blob createBlob(InputStream inputStream) throws IOException { return getNodeStore().createBlob(inputStream); }
@Override @NotNull public Blob createBlob(@NotNull InputStream inputStream) throws IOException { checkLive(); return store.createBlob(checkNotNull(inputStream)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private static Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); }
private Blob getRandomBlob(NodeStore target) throws IOException { Random r = new Random(); byte[] buff = new byte[512 * 1024]; r.nextBytes(buff); return target.createBlob(new ByteArrayInputStream(buff)); }
private Blob createBlob(NodeStore nodeStore, int size) throws IOException { byte[] data = new byte[size]; new Random().nextBytes(data); return nodeStore.createBlob(new ByteArrayInputStream(data)); } }
private NodeBuilder addFile(NodeBuilder node, String name) throws IOException { NodeBuilder file = addChild(node, name, JcrConstants.NT_FILE); NodeBuilder content = addChild(file, JcrConstants.JCR_CONTENT, JcrConstants.NT_RESOURCE); content.setProperty(JcrConstants.JCR_MIMETYPE, "text/plain"); Blob blob = store.createBlob(new ByteArrayInputStream("Apache Oak".getBytes())); content.setProperty(JcrConstants.JCR_DATA, blob); return file; }
protected byte[] addTestContent(NodeStore store, String child, int size) throws CommitFailedException, IOException { NodeBuilder builder = store.getRoot().builder(); builder.child(child).setProperty("ts", System.currentTimeMillis()); byte[] data = new byte[size]; new Random().nextBytes(data); Blob blob = store.createBlob(new ByteArrayInputStream(data)); builder.child(child).setProperty("testBlob", blob); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); return data; }
private HashSet<String> addInlined(NodeStore nodeStore) throws Exception { HashSet<String> set = new HashSet<String>(); NodeBuilder a = nodeStore.getRoot().builder(); int number = 4; for (int i = 0; i < number; i++) { Blob b = nodeStore.createBlob(randomStream(i, 40)); a.child("cinline" + i).setProperty("x", b); } nodeStore.merge(a, EmptyHook.INSTANCE, CommitInfo.EMPTY); return set; }
private void addTestContentOnTheFly(NodeStore store, String child, long size, int seed) throws CommitFailedException, IOException { NodeBuilder builder = store.getRoot().builder(); builder.child(child).setProperty("ts", System.currentTimeMillis()); InputStream randomInputStream = newRandomInputStream(size, seed); Blob blob = store.createBlob(randomInputStream); builder.child(child).setProperty("testBlob", blob); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
@Test public void existingBlobsInMountedStoreAreRetrieved() throws Exception { assumeTrue(mounts.supportsBlobCreation()); Blob createdBlob = mountedStore.createBlob(createLargeBlob()); Blob retrievedBlob = store.getBlob(createdBlob.getReference()); assertThat(retrievedBlob.getContentIdentity(), equalTo(createdBlob.getContentIdentity())); }
@Test public void existingBlobsInRootStoreAreRetrieved() throws Exception { assumeTrue(root.supportsBlobCreation()); Blob createdBlob = globalStore.createBlob(createLargeBlob()); Blob retrievedBlob = store.getBlob(createdBlob.getReference()); assertThat(retrievedBlob.getContentIdentity(), equalTo(createdBlob.getContentIdentity())); }