X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Futil%2Ffreenet%2Ffcp2%2FClientPutComplexDir.java;h=1f6a43b7db6e51fcb0e32d7001b9acc49bef8245;hb=6dfface585b41b2c2a43eb249c581cdab0b308f4;hp=12d963d7b53768b94a3c949b6446ee6973996d74;hpb=c64e48e653f169c3683636bee575422c9f6704b1;p=jSite.git
diff --git a/src/de/todesbaum/util/freenet/fcp2/ClientPutComplexDir.java b/src/de/todesbaum/util/freenet/fcp2/ClientPutComplexDir.java
index 12d963d..1f6a43b 100644
--- a/src/de/todesbaum/util/freenet/fcp2/ClientPutComplexDir.java
+++ b/src/de/todesbaum/util/freenet/fcp2/ClientPutComplexDir.java
@@ -52,13 +52,33 @@ public class ClientPutComplexDir extends ClientPutDir {
/** The total number of bytes of the payload. */
private long payloadLength = 0;
+ /** The temp directory to use. */
+ private final String tempDirectory;
+
/**
* Creates a new ClientPutComplexDir
command with the specified identifier and URI.
* @param identifier The identifier of the command
* @param uri The URI of the command
*/
public ClientPutComplexDir(String identifier, String uri) {
+ this(identifier, uri, null);
+ }
+
+ /**
+ * Creates a new ClientPutComplexDir
command with the specified
+ * identifier and URI.
+ *
+ * @param identifier
+ * The identifier of the command
+ * @param uri
+ * The URI of the command
+ * @param tempDirectory
+ * The temp directory to use, or {@code null} to use the default
+ * temp directory
+ */
+ public ClientPutComplexDir(String identifier, String uri, String tempDirectory) {
super("ClientPutComplexDir", identifier, uri);
+ this.tempDirectory = tempDirectory;
}
/**
@@ -69,7 +89,7 @@ public class ClientPutComplexDir extends ClientPutDir {
if (fileEntry instanceof DirectFileEntry) {
if (payloadFile == null){
try {
- payloadFile = File.createTempFile("payload", ".dat");
+ payloadFile = File.createTempFile("payload", ".dat", (tempDirectory != null) ? new File(tempDirectory) : null);
payloadFile.deleteOnExit();
} catch (IOException e) {
}