mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-19 15:54:52 +01:00
ensured subdirectories are built while extracting tar files - issue #43
Former-commit-id: af8b794ed9be453e2aad6807e238826468cc5d3e
This commit is contained in:
@@ -295,7 +295,7 @@ public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
final File d = new File(destination, entry.getName());
|
final File d = new File(destination, entry.getName());
|
||||||
if (!d.exists()) {
|
if (!d.exists()) {
|
||||||
if (!d.mkdirs()) {
|
if (!d.mkdirs()) {
|
||||||
final String msg = String.format("Unable to create '%s'.", d.getAbsolutePath());
|
final String msg = String.format("Unable to create directory '%s'.", d.getAbsolutePath());
|
||||||
throw new AnalysisException(msg);
|
throw new AnalysisException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,6 +306,13 @@ public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
BufferedOutputStream bos = null;
|
BufferedOutputStream bos = null;
|
||||||
FileOutputStream fos;
|
FileOutputStream fos;
|
||||||
try {
|
try {
|
||||||
|
File parent = file.getParentFile();
|
||||||
|
if (!parent.isDirectory()) {
|
||||||
|
if (!parent.mkdirs()) {
|
||||||
|
final String msg = String.format("Unable to build directory '%s'.", parent.getAbsolutePath());
|
||||||
|
throw new AnalysisException(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
fos = new FileOutputStream(file);
|
fos = new FileOutputStream(file);
|
||||||
bos = new BufferedOutputStream(fos, BUFFER_SIZE);
|
bos = new BufferedOutputStream(fos, BUFFER_SIZE);
|
||||||
int count;
|
int count;
|
||||||
|
|||||||
Reference in New Issue
Block a user