@Override public ListenableFuture<Boolean> createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) return transform(async.createDirectory(container, publicRead()), new Function<URI, Boolean>() { public Boolean apply(URI from) { return from != null; } }, userExecutor); return createContainerInLocation(location, container); }
public void testUpdateFileOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(AtmosClient.class, "updateFile", String.class, AtmosObject.class, PutOptions[].class); GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("dir", blobToObject .apply(BindBlobToMultipartFormTest.TEST_BLOB), PutOptions.Builder.publicRead())); assertRequestLineEquals(request, "PUT https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, ThrowKeyNotFoundOn404.class); checkFilters(request); }
public void testCreateFileOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(AtmosClient.class, "createFile", String.class, AtmosObject.class, PutOptions[].class); GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("dir", blobToObject .apply(BindBlobToMultipartFormTest.TEST_BLOB), PutOptions.Builder.publicRead())); assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, null); checkFilters(request); }
public void testUpdateFileOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(AtmosAsyncClient.class, "updateFile", String.class, AtmosObject.class, PutOptions[].class); GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("dir", blobToObject .apply(BindBlobToMultipartFormTest.TEST_BLOB), PutOptions.Builder.publicRead())); assertRequestLineEquals(request, "PUT https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, ThrowKeyNotFoundOn404.class); checkFilters(request); }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { return sync.createDirectory(container, publicRead()) != null; } return createContainerInLocation(location, container); }
public void testCreateFileOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(AtmosAsyncClient.class, "createFile", String.class, AtmosObject.class, PutOptions[].class); GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("dir", blobToObject .apply(BindBlobToMultipartFormTest.TEST_BLOB), PutOptions.Builder.publicRead())); assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, null); checkFilters(request); }
public void testCreateDirectoryOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(AtmosClient.class, "createDirectory", String.class, PutOptions[].class); GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("dir", PutOptions.Builder.publicRead())); assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/ HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "", "application/octet-stream", false); assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, NullOnKeyAlreadyExists.class); checkFilters(request); }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { sync.createDirectory(container, publicRead()); return true; } return createContainerInLocation(location, container); } }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { return sync.createDirectory(container, publicRead()) != null; } return createContainerInLocation(location, container); } }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { return sync.createDirectory(container, publicRead()) != null; } return createContainerInLocation(location, container); }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { return sync.createDirectory(container, publicRead()) != null; } return createContainerInLocation(location, container); }
@Override public ListenableFuture<Boolean> createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) return transform(async.createDirectory(container, publicRead()), new Function<URI, Boolean>() { public Boolean apply(URI from) { return true; } }, userExecutor); return createContainerInLocation(location, container); }
@Override public ListenableFuture<Boolean> createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) return transform(async.createDirectory(container, publicRead()), new Function<URI, Boolean>() { public Boolean apply(URI from) { return true; } }, userExecutor); return createContainerInLocation(location, container); }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { sync.createDirectory(container, publicRead()); return true; } return createContainerInLocation(location, container); } }
public void testCreateDirectoryOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(AtmosAsyncClient.class, "createDirectory", String.class, PutOptions[].class); GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("dir", PutOptions.Builder.publicRead())); assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/ HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "", "application/octet-stream", false); assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, EndpointIfAlreadyExists.class); checkFilters(request); }
@Override public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { if (options.isPublicRead()) { return sync.createDirectory(container, publicRead()) != null; } return createContainerInLocation(location, container); }