Skip to content

Commit

Permalink
Merge pull request #29 from gabibau/master
Browse files Browse the repository at this point in the history
Re-creates missing download folder if needed.
  • Loading branch information
nroduit authored Mar 1, 2018
2 parents 6524387 + 7712e90 commit 00f6fb5
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,15 @@ public Boolean call() throws Exception {
return Boolean.TRUE;
}

// Solves missing tmp folder problem (on Windows).
private File getDicomTmpDir() {
if (!DICOM_TMP_DIR.exists()) {
LOGGER.info("DICOM tmp dir not foud. Re-creating it!");
AppProperties.buildAccessibleTempDirectory("downloading");
}
return DICOM_TMP_DIR;
}

/**
* Download file.
*
Expand All @@ -670,7 +679,7 @@ private boolean process() throws IOException, URISyntaxException {
cache = false;
}
if (cache) {
tempFile = File.createTempFile("image_", ".dcm", DICOM_TMP_DIR); //$NON-NLS-1$ //$NON-NLS-2$
tempFile = File.createTempFile("image_", ".dcm", getDicomTmpDir()); //$NON-NLS-1$ //$NON-NLS-2$
}

// Cannot resume with WADO because the stream is modified on the fly by the wado server. In dcm4chee, see
Expand Down

0 comments on commit 00f6fb5

Please sign in to comment.