|
|
|
@ -157,6 +157,10 @@ public class ArbitraryDataReader {
|
|
|
|
|
this.uncompress(); |
|
|
|
|
this.validate(); |
|
|
|
|
|
|
|
|
|
} catch (DataException e) { |
|
|
|
|
this.deleteWorkingDirectory(); |
|
|
|
|
throw new DataException(e.getMessage()); |
|
|
|
|
|
|
|
|
|
} finally { |
|
|
|
|
this.postExecute(); |
|
|
|
|
} |
|
|
|
@ -187,6 +191,15 @@ public class ArbitraryDataReader {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Working directory should only be deleted on failure, since it is currently used to |
|
|
|
|
* serve a cached version of the resource for subsequent requests. |
|
|
|
|
* @throws IOException |
|
|
|
|
*/ |
|
|
|
|
private void deleteWorkingDirectory() throws IOException { |
|
|
|
|
FilesystemUtils.safeDeleteDirectory(this.workingPath, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createUncompressedDirectory() throws DataException { |
|
|
|
|
try { |
|
|
|
|
// Create parent directory
|
|
|
|
|