/** Object used for synchronization. */
protected final Object lockObject = new Object();
+ /** The temp directory. */
+ private String tempDirectory;
+
/**
* Adds a listener to the list of registered listeners.
*
}
/**
+ * Sets the temp directory to use.
+ *
+ * @param tempDirectory
+ * The temp directory to use, or {@code null} to use the system
+ * default
+ */
+ public void setTempDirectory(String tempDirectory) {
+ this.tempDirectory = tempDirectory;
+ }
+
+ /**
* Starts the insert.
*/
public void start() {
* if an I/O error occurs
*/
private InputStream createContainerInputStream(Map<String, List<String>> containerFiles, String containerName, int edition, long[] containerLength) throws IOException {
- File tempFile = File.createTempFile("jsite", ".zip");
+ File tempFile = File.createTempFile("jsite", ".zip", (tempDirectory == null) ? null : new File(tempDirectory));
tempFile.deleteOnExit();
FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream);