/** Encryption algorithm, may be a null instance that provides pass-through. */
private final WalkEncryption encryption;
+ /** Directory for locally buffered content. */
+ private final File tmpDir;
+
/**
* Create a new S3 client for the supplied user information.
* <p>
maxAttempts = Integer.parseInt(props.getProperty(
"httpclient.retry-max", "3")); //$NON-NLS-1$ //$NON-NLS-2$
proxySelector = ProxySelector.getDefault();
+
+ String tmp = props.getProperty("tmpdir"); //$NON-NLS-1$
+ tmpDir = tmp != null && tmp.length() > 0 ? new File(tmp) : null;
}
/**
final ProgressMonitor monitor, final String monitorTask)
throws IOException {
final MessageDigest md5 = newMD5();
- final TemporaryBuffer buffer = new TemporaryBuffer.LocalFile() {
+ final TemporaryBuffer buffer = new TemporaryBuffer.LocalFile(tmpDir) {
@Override
public void close() throws IOException {
super.close();
throws NotSupportedException {
super(local, uri);
- s3 = new AmazonS3(loadProperties());
+ Properties props = loadProperties();
+ if (!props.contains("tmpdir") && local.getDirectory() != null) //$NON-NLS-1$
+ props.put("tmpdir", local.getDirectory().getPath()); //$NON-NLS-1$
+
+ s3 = new AmazonS3(props);
bucket = uri.getHost();
String p = uri.getPath();