> +   @Override
> +   public JoyentBlobMetadataParser<RETURN> setContext(HttpRequest request) {
> +      if (request instanceof GeneratedHttpRequest) {
> +
> +         List args = ((GeneratedHttpRequest) 
> request).getInvocation().getArgs();
> +
> +         container = (String) args.get(0);
> +         blobName = (String) args.get(1);
> +      }
> +
> +      String reqURL = request.getEndpoint().toString();
> +      String path = request.getEndpoint().getPath();
> +      String storPath = "/" + identity + "/" + JoyentConstants.STOR_PATH;
> +      if (!path.startsWith(storPath)) {
> +         int pathInd = reqURL.lastIndexOf(path);
> +         String newUrl = reqURL.substring(0, pathInd) + storPath + 
> reqURL.substring(pathInd);

This same code is also used when signing the requests. Could you 
extract/refactor it so you have it only in one place?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/30/files#r7260263

Reply via email to