@Test public void createMultipartRequestSupplierWithUriRootPathStyleTest() throws URISyntaxException { final URI uri = new URI("http: + this.vaultName + "/" + this.objectName + "?uploads"); final long objectSize = 10; final MultipartRequestSupplier request = createRequestSupplier(false, this.vaultName, this.hostName, this.objectName, objectSize, this.uriRoot, 1, false); final Request req = request.get(); Assert.assertNotNull(req); Assert.assertEquals(Method.POST, req.getMethod()); Assert.assertEquals(uri, req.getUri()); }
@Override public Request get() { final Map<String, String> requestContext = Maps.newHashMap(); HttpRequest.Builder builder; builder = sessionManager.getNextRequest(requestContext); if (builder != null) { if (this.headers != null) { for (final Map.Entry<String, Function<Map<String, String>, String>> header : this.headers .entrySet()) { builder.withHeader(header.getKey(), header.getValue().apply(requestContext)); } } if (this.id != null) { builder.withContext(Context.X_OG_REQUEST_ID, this.id.apply(requestContext)); } if (credentials != null) { Credential credential = this.credentials.apply(requestContext); String username = credential.getUsername(); String password = credential.getPassword(); String keystoneToken = credential.getKeystoneToken(); String IAMToken = credential.getIAMToken(); if (username != null) builder.withContext(Context.X_OG_USERNAME, username); if (password != null) builder.withContext(Context.X_OG_PASSWORD, password); if (keystoneToken != null) builder.withContext(Context.X_OG_KEYSTONE_TOKEN, keystoneToken); if (IAMToken != null) builder.withContext(Context.X_OG_IAM_TOKEN, IAMToken); } for (final Map.Entry<String, String> entry : requestContext.entrySet()) { builder.withContext(entry.getKey(), entry.getValue()); } builder.withContext(Context.X_OG_RESPONSE_BODY_CONSUMER, "s3.multipart"); return builder.build(); } else { return null; } }
MultipartRequestSupplier implements Supplier<Request> { @Override public Request get() { final Map<String, String> requestContext = Maps.newHashMap(); HttpRequest.Builder builder; builder = sessionManager.getNextRequest(requestContext); if (builder != null) { if (this.headers != null) { for (final Map.Entry<String, Function<Map<String, String>, String>> header : this.headers .entrySet()) { builder.withHeader(header.getKey(), header.getValue().apply(requestContext)); } } if (this.id != null) { builder.withContext(Context.X_OG_REQUEST_ID, this.id.apply(requestContext)); } if (credentials != null) { Credential credential = this.credentials.apply(requestContext); String username = credential.getUsername(); String password = credential.getPassword(); String keystoneToken = credential.getKeystoneToken(); String IAMToken = credential.getIAMToken(); if (username != null) builder.withContext(Context.X_OG_USERNAME, username); if (password != null) builder.withContext(Context.X_OG_PASSWORD, password); if (keystoneToken != null) builder.withContext(Context.X_OG_KEYSTONE_TOKEN, keystoneToken); if (IAMToken != null) builder.withContext(Context.X_OG_IAM_TOKEN, IAMToken); } for (final Map.Entry<String, String> entry : requestContext.entrySet()) { builder.withContext(entry.getKey(), entry.getValue()); } builder.withContext(Context.X_OG_RESPONSE_BODY_CONSUMER, "s3.multipart"); return builder.build(); } else { return null; } } }
MultipartRequestSupplier implements Supplier<Request> { @Override public Request get() { final Map<String, String> requestContext = Maps.newHashMap(); HttpRequest.Builder builder; builder = sessionManager.getNextRequest(requestContext); if (builder != null) { if (this.headers != null) { for (final Map.Entry<String, Function<Map<String, String>, String>> header : this.headers .entrySet()) { builder.withHeader(header.getKey(), header.getValue().apply(requestContext)); } } if (this.id != null) { builder.withContext(Context.X_OG_REQUEST_ID, this.id.apply(requestContext)); } if (credentials != null) { Credential credential = this.credentials.apply(requestContext); String username = credential.getUsername(); String password = credential.getPassword(); String keystoneToken = credential.getKeystoneToken(); String IAMToken = credential.getIAMToken(); if (username != null) builder.withContext(Context.X_OG_USERNAME, username); if (password != null) builder.withContext(Context.X_OG_PASSWORD, password); if (keystoneToken != null) builder.withContext(Context.X_OG_KEYSTONE_TOKEN, keystoneToken); if (IAMToken != null) builder.withContext(Context.X_OG_IAM_TOKEN, IAMToken); } for (final Map.Entry<String, String> entry : requestContext.entrySet()) { builder.withContext(entry.getKey(), entry.getValue()); } builder.withContext(Context.X_OG_RESPONSE_BODY_CONSUMER, "s3.multipart"); return builder.build(); } else { return null; } } MultipartRequestSupplier(final Function<Map<String, String>, String> id,
      final Scheme scheme, final Function<Map<String, String>, String> host,
      final Integer port, final String uriRoot,
      final Function<Map<String, String>, String> container,
      final Function<Map<String, String>, String> object,
      final Function<Map<String, String>, Long> partSize,
      final Function<Map<String, String>, Integer> partsPerSession,
      final int targetSessions,
      final Map<String, Function<Map<String, String>, String>> queryParameters,
      final boolean trailingSlash, final Map<String, Function<Map<String, String>, String>> headers,
      final List<Function<Map<String, String>, String>> context,
      final Function<Map<String, String>, Credential> credentials,
      final Function<Map<String, String>, Body> body, final boolean virtualHost,
      final Function<Map<String, String>, Long> retention,
      final Supplier<Function<Map<String, String>, String>> legalHold,
      final boolean contentMd5, final Function<Map<String, String>, String> delimiter); }
MultipartRequestSupplier implements Supplier<Request> { @Override public Request get() { final Map<String, String> requestContext = Maps.newHashMap(); HttpRequest.Builder builder; builder = sessionManager.getNextRequest(requestContext); if (builder != null) { if (this.headers != null) { for (final Map.Entry<String, Function<Map<String, String>, String>> header : this.headers .entrySet()) { builder.withHeader(header.getKey(), header.getValue().apply(requestContext)); } } if (this.id != null) { builder.withContext(Context.X_OG_REQUEST_ID, this.id.apply(requestContext)); } if (credentials != null) { Credential credential = this.credentials.apply(requestContext); String username = credential.getUsername(); String password = credential.getPassword(); String keystoneToken = credential.getKeystoneToken(); String IAMToken = credential.getIAMToken(); if (username != null) builder.withContext(Context.X_OG_USERNAME, username); if (password != null) builder.withContext(Context.X_OG_PASSWORD, password); if (keystoneToken != null) builder.withContext(Context.X_OG_KEYSTONE_TOKEN, keystoneToken); if (IAMToken != null) builder.withContext(Context.X_OG_IAM_TOKEN, IAMToken); } for (final Map.Entry<String, String> entry : requestContext.entrySet()) { builder.withContext(entry.getKey(), entry.getValue()); } builder.withContext(Context.X_OG_RESPONSE_BODY_CONSUMER, "s3.multipart"); return builder.build(); } else { return null; } } MultipartRequestSupplier(final Function<Map<String, String>, String> id,
      final Scheme scheme, final Function<Map<String, String>, String> host,
      final Integer port, final String uriRoot,
      final Function<Map<String, String>, String> container,
      final Function<Map<String, String>, String> object,
      final Function<Map<String, String>, Long> partSize,
      final Function<Map<String, String>, Integer> partsPerSession,
      final int targetSessions,
      final Map<String, Function<Map<String, String>, String>> queryParameters,
      final boolean trailingSlash, final Map<String, Function<Map<String, String>, String>> headers,
      final List<Function<Map<String, String>, String>> context,
      final Function<Map<String, String>, Credential> credentials,
      final Function<Map<String, String>, Body> body, final boolean virtualHost,
      final Function<Map<String, String>, Long> retention,
      final Supplier<Function<Map<String, String>, String>> legalHold,
      final boolean contentMd5, final Function<Map<String, String>, String> delimiter); @Subscribe void update(final Pair<Request, Response> result); @Override Request get(); void abortSessions(); @Override String toString(); }
MultipartRequestSupplier implements Supplier<Request> { @Override public Request get() { final Map<String, String> requestContext = Maps.newHashMap(); HttpRequest.Builder builder; builder = sessionManager.getNextRequest(requestContext); if (builder != null) { if (this.headers != null) { for (final Map.Entry<String, Function<Map<String, String>, String>> header : this.headers .entrySet()) { builder.withHeader(header.getKey(), header.getValue().apply(requestContext)); } } if (this.id != null) { builder.withContext(Context.X_OG_REQUEST_ID, this.id.apply(requestContext)); } if (credentials != null) { Credential credential = this.credentials.apply(requestContext); String username = credential.getUsername(); String password = credential.getPassword(); String keystoneToken = credential.getKeystoneToken(); String IAMToken = credential.getIAMToken(); if (username != null) builder.withContext(Context.X_OG_USERNAME, username); if (password != null) builder.withContext(Context.X_OG_PASSWORD, password); if (keystoneToken != null) builder.withContext(Context.X_OG_KEYSTONE_TOKEN, keystoneToken); if (IAMToken != null) builder.withContext(Context.X_OG_IAM_TOKEN, IAMToken); } for (final Map.Entry<String, String> entry : requestContext.entrySet()) { builder.withContext(entry.getKey(), entry.getValue()); } builder.withContext(Context.X_OG_RESPONSE_BODY_CONSUMER, "s3.multipart"); return builder.build(); } else { return null; } } MultipartRequestSupplier(final Function<Map<String, String>, String> id,
      final Scheme scheme, final Function<Map<String, String>, String> host,
      final Integer port, final String uriRoot,
      final Function<Map<String, String>, String> container,
      final Function<Map<String, String>, String> object,
      final Function<Map<String, String>, Long> partSize,
      final Function<Map<String, String>, Integer> partsPerSession,
      final int targetSessions,
      final Map<String, Function<Map<String, String>, String>> queryParameters,
      final boolean trailingSlash, final Map<String, Function<Map<String, String>, String>> headers,
      final List<Function<Map<String, String>, String>> context,
      final Function<Map<String, String>, Credential> credentials,
      final Function<Map<String, String>, Body> body, final boolean virtualHost,
      final Function<Map<String, String>, Long> retention,
      final Supplier<Function<Map<String, String>, String>> legalHold,
      final boolean contentMd5, final Function<Map<String, String>, String> delimiter); @Subscribe void update(final Pair<Request, Response> result); @Override Request get(); void abortSessions(); @Override String toString();  }