private static final String HMAC = "HmacSHA1"; //$NON-NLS-1$
- private static final String DOMAIN = "s3.amazonaws.com"; //$NON-NLS-1$
-
private static final String X_AMZ_ACL = "x-amz-acl"; //$NON-NLS-1$
private static final String X_AMZ_META = "x-amz-meta-"; //$NON-NLS-1$
/** Directory for locally buffered content. */
private final File tmpDir;
+ /** S3 Bucket Domain. */
+ private final String domain;
+
/**
* Create a new S3 client for the supplied user information.
* <p>
* # PRIVATE, PUBLIC_READ (defaults to PRIVATE).
* acl: PRIVATE
*
+ * # S3 Domain
+ * # AWS S3 Region Domain (defaults to s3.amazonaws.com)
+ * domain: s3.amazonaws.com
+ *
* # Number of times to retry after internal error from S3.
* httpclient.retry-max: 3
*
*
*/
public AmazonS3(final Properties props) {
+ domain = props.getProperty("domain", "s3.amazonaws.com"); //$NON-NLS-1$ //$NON-NLS-2$
publicKey = props.getProperty("accesskey"); //$NON-NLS-1$
if (publicKey == null)
throw new IllegalArgumentException(JGitText.get().missingAccesskey);
urlstr.append("http://"); //$NON-NLS-1$
urlstr.append(bucket);
urlstr.append('.');
- urlstr.append(DOMAIN);
+ urlstr.append(domain);
urlstr.append('/');
if (key.length() > 0)
HttpSupport.encode(urlstr, key);
final String host = c.getURL().getHost();
s.append('/');
- s.append(host.substring(0, host.length() - DOMAIN.length() - 1));
+ s.append(host.substring(0, host.length() - domain.length() - 1));
s.append(c.getURL().getPath());
final String sec;