+ RestUtils.encodeUrlString(key); if(value != null && value.length() > 0) { urlPath += "=" + RestUtils.encodeUrlString(value); if(log.isDebugEnabled()) { log.debug("Added request parameter: " + key + "=" + value);
+ RestUtils.encodeUrlString(key); if(value != null && value.length() > 0) { urlPath += "=" + RestUtils.encodeUrlString(value); if(log.isDebugEnabled()) { log.debug("Added request parameter: " + key + "=" + value);
result.append(encodeSlash ? "%2F" : ch); } else { String hex = RestUtils.encodeUrlString(String.valueOf(ch)); result.append(hex);
/** * Encodes a URL string but leaves a delimiter string unencoded. * Spaces are encoded as "%20" instead of "+". * * @param path * @param delimiter * @return * encoded URL string. */ public static String encodeUrlPath(String path, String delimiter) { final StringBuilder result = new StringBuilder(); final StringTokenizer t = new StringTokenizer(path, delimiter); if(!t.hasMoreTokens()) { return path; } if(path.startsWith(delimiter)) { result.append(delimiter); } while(t.hasMoreTokens()) { result.append(encodeUrlString(t.nextToken())); if(t.hasMoreTokens()) { result.append(delimiter); } } if(path.endsWith(delimiter)) { result.append(delimiter); } return result.toString(); }
result.append(encodeSlash ? "%2F" : ch); } else { String hex = RestUtils.encodeUrlString(String.valueOf(ch)); result.append(hex);
/** * Encodes a URL string but leaves a delimiter string unencoded. * Spaces are encoded as "%20" instead of "+". * * @param path * @param delimiter * @return * encoded URL string. */ public static String encodeUrlPath(String path, String delimiter) { final StringBuilder result = new StringBuilder(); final StringTokenizer t = new StringTokenizer(path, delimiter); if(!t.hasMoreTokens()) { return path; } if(path.startsWith(delimiter)) { result.append(delimiter); } while(t.hasMoreTokens()) { result.append(encodeUrlString(t.nextToken())); if(t.hasMoreTokens()) { result.append(delimiter); } } if(path.endsWith(delimiter)) { result.append(delimiter); } return result.toString(); }
RestUtils.encodeUrlString((String) headersMap.get(Constants.AMZ_SECURITY_TOKEN)) + "&"; String encodedCanonical = RestUtils.encodeUrlString(signedCanonical); uriPath += "&Signature=" + encodedCanonical;
/** * Generates a URL string that will return a Torrent file for an object in S3, * which file can be downloaded and run in a BitTorrent client. * * @param bucket the name of the bucket containing the object. * @param key the name of the object. * @return a URL to a Torrent file representing the object. */ public String create(final String bucket, final String key) { String s3Endpoint = endpoint.getHostname(); String serviceEndpointVirtualPath = ""; String bucketNameInPath = ServiceUtils.isBucketNameValidDNSName(bucket) ? "" : RestUtils.encodeUrlString(bucket) + "/"; String urlPath = RestUtils.encodeUrlPath(serviceEndpointVirtualPath, "/") + "/" + bucketNameInPath + RestUtils.encodeUrlPath(key, "/"); return "http://" + ServiceUtils.generateS3HostnameForBucket( bucket, false, s3Endpoint) + urlPath + "?torrent"; } }
RestUtils.encodeUrlString((String) headersMap.get(Constants.AMZ_SECURITY_TOKEN)) + "&"; String encodedCanonical = RestUtils.encodeUrlString(signedCanonical); uriPath += "&Signature=" + encodedCanonical;
!disableDnsBuckets && ServiceUtils.isBucketNameValidDNSName(bucketName) ? "" : RestUtils.encodeUrlString(bucketName) + "/"; String urlPath = RestUtils.encodeUrlPath(serviceEndpointVirtualPath, "/")
!disableDnsBuckets && ServiceUtils.isBucketNameValidDNSName(bucketName) ? "" : RestUtils.encodeUrlString(bucketName) + "/"; String urlPath = RestUtils.encodeUrlPath(serviceEndpointVirtualPath, "/")