forked from Qortal/qortal
Delete reader cache directories if a resource is unable to be built.
This commit is contained in:
parent
17fe94fa46
commit
c4a782301d
@ -157,6 +157,10 @@ public class ArbitraryDataReader {
|
|||||||
this.uncompress();
|
this.uncompress();
|
||||||
this.validate();
|
this.validate();
|
||||||
|
|
||||||
|
} catch (DataException e) {
|
||||||
|
this.deleteWorkingDirectory();
|
||||||
|
throw new DataException(e.getMessage());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
this.postExecute();
|
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 {
|
private void createUncompressedDirectory() throws DataException {
|
||||||
try {
|
try {
|
||||||
// Create parent directory
|
// Create parent directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user