String pathRemainder = iconResourcePath.substring(firstSlashIndex); URL baseUrl = this.getClass().getResource(firstPathComponent); iconUrl = new URL(baseUrl.toString() + RestUtils.encodeUrlPath(pathRemainder, "/"));
String pathRemainder = iconResourcePath.substring(firstSlashIndex); URL baseUrl = this.getClass().getResource(firstPathComponent); iconUrl = new URL(baseUrl.toString() + RestUtils.encodeUrlPath(pathRemainder, "/"));
/** * 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"; } }
String sourceKey = RestUtils.encodeUrlPath(sourceBucketName + "/" + sourceObjectKey, "/");
String sourceKey = RestUtils.encodeUrlPath(sourceBucketName + "/" + sourceObjectKey, "/");
: RestUtils.encodeUrlString(bucketName) + "/"; String urlPath = RestUtils.encodeUrlPath(serviceEndpointVirtualPath, "/") + "/" + bucketNameInPath + RestUtils.encodeUrlPath(objectKey, "/"); return "http://" + ServiceUtils.generateS3HostnameForBucket( bucketName, disableDnsBuckets, s3Endpoint)
: RestUtils.encodeUrlString(bucketName) + "/"; String urlPath = RestUtils.encodeUrlPath(serviceEndpointVirtualPath, "/") + "/" + bucketNameInPath + RestUtils.encodeUrlPath(objectKey, "/"); return "http://" + ServiceUtils.generateS3HostnameForBucket( bucketName, disableDnsBuckets, s3Endpoint)
String sourceKey = RestUtils.encodeUrlPath("/" + sourceBucketName + "/" + sourceObjectKey, "/");
String sourceKey = RestUtils.encodeUrlPath("/" + sourceBucketName + "/" + sourceObjectKey, "/");
XMLBuilder items = paths.e("Items"); for(String objectPath : objectKeys) { String encodedPath = RestUtils.encodeUrlPath(objectPath, "/"); if(!encodedPath.startsWith("/")) { encodedPath = "/" + encodedPath;
uriPath = (objectKey != null ? RestUtils.encodeUrlPath(objectKey, "/") : ""); } else { uriPath = bucketName + (objectKey != null ? "/" + RestUtils.encodeUrlPath(objectKey, "/") : "");
XMLBuilder items = paths.e("Items"); for(String objectPath : objectKeys) { String encodedPath = RestUtils.encodeUrlPath(objectPath, "/"); if(!encodedPath.startsWith("/")) { encodedPath = "/" + encodedPath;
uriPath = (objectKey != null ? RestUtils.encodeUrlPath(objectKey, "/") : ""); } else { uriPath = bucketName + (objectKey != null ? "/" + RestUtils.encodeUrlPath(objectKey, "/") : "");
resourceString += bucketName + "/"; resourceString += (objectKey != null ? RestUtils.encodeUrlPath(objectKey, "/") : "");
resourceString += bucketName + "/"; resourceString += (objectKey != null ? RestUtils.encodeUrlPath(objectKey, "/") : "");