@Override public T getContents() { return filterReadData(path, resource.getContents()); } };
@Override public T getContents() { return delegate.getContents(); }
private static byte[] readBytes(Resource<ResourceMeta> resource) throws IOException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); resource.getContents().writeContent(byteArrayOutputStream); return byteArrayOutputStream.toByteArray(); }
@Override public void didGetPath(Path path, Resource<ResourceMeta> resource) { log(path, "get", resource.getContents() == null, null, null); }
private byte[] loadStoragePathData(final String passwordStoragePath) throws IOException { if (null == passwordStoragePath) { return null; } ResourceMeta contents = context.getStorageTree().getResource(passwordStoragePath).getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream); return byteArrayOutputStream.toByteArray(); }
private byte[] loadStoragePathData(final String passwordStoragePath) throws IOException { if (null == passwordStoragePath) { return null; } ResourceMeta contents = context.getStorageTree().getResource(passwordStoragePath).getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream); return byteArrayOutputStream.toByteArray(); }
@Override public void didGetResource(Path path, Resource<ResourceMeta> resource) { log(path, "get", false, resource.getContents().getMeta(), null); }
@Override public boolean hasResourceWithType(final Path path, final String contentType) { boolean exists = hasResource(path); if (!exists) { return false; } Resource<ResourceMeta> resource = getResource(path); return resource.getContents().getContentType().equals(contentType); }
@Override public Resource<ResourceMeta> getResourceWithType(Path path, String contentType) { Resource<ResourceMeta> resource = getResource(path); if (resource.getContents().getContentType().equals(contentType)) { return resource; } throw new WrongContentType( "Path ${path} does not store a password, content-type: ${resource.contents.contentType}", StorageException.Event.READ, path ); }
@Override public Resource<T> getPath(Path path) { Resource<T> path1 = super.getPath(path); if (matches(path, null != path1 ? path1.getContents() : null)) { listener.didGetPath(path, path1); } return path1; }
@Override public Resource<T> getResource(Path path) { Resource<T> resource = super.getResource(path); if (matches(path, resource.getContents())) { listener.didGetResource(path, resource); } return resource; }
public InputStream getPrivateKeyStorageData() throws IOException { String privateKeyResourcePath = getPrivateKeyStoragePath(); if (null == privateKeyResourcePath) { return null; } return context .getStorageTree() .getResource(privateKeyResourcePath) .getContents() .getInputStream(); }
public InputStream getPrivateKeyStorageData() throws IOException { String privateKeyResourcePath = getPrivateKeyStoragePath(); if (null == privateKeyResourcePath) { return null; } return context .getStorageTree() .getResource(privateKeyResourcePath) .getContents() .getInputStream(); }
@Override public Resource<T> getResource(Path path) { final Resource<T> resource = super.getResource(path); if (!resource.isDirectory() && MatcherUtil.matches(path, resource.getContents(), pathSelector, resourceSelector)) { return filterGetResource(path, resource); } return resource; }
@Override public Resource<T> getPath(Path path) { final Resource<T> resource = super.getPath(path); if (!resource.isDirectory() && MatcherUtil.matches(path, resource.getContents(), pathSelector, resourceSelector)) { return filterGetResource(path, resource); } return resource; }
try { ResourceMeta contents = context.getStorageTree().getResource(path) .getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream);
try { ResourceMeta contents = context.getStorageTree().getResource(path) .getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream);
try { ResourceMeta contents = context.getStorageTree().getResource(path) .getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream);
try { ResourceMeta contents = context.getStorageTree().getResource(path) .getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream);
try { ResourceMeta contents = context.getStorageTree().getResource(path) .getContents(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); contents.writeContent(byteArrayOutputStream);