|
|
@ -55,16 +55,19 @@ class BootZipCopyAction implements CopyAction {
|
|
|
|
|
|
|
|
|
|
|
|
private final Spec<FileTreeElement> requiresUnpack;
|
|
|
|
private final Spec<FileTreeElement> requiresUnpack;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Spec<FileTreeElement> exclusions;
|
|
|
|
|
|
|
|
|
|
|
|
private final LaunchScriptConfiguration launchScript;
|
|
|
|
private final LaunchScriptConfiguration launchScript;
|
|
|
|
|
|
|
|
|
|
|
|
private final Set<String> storedPathPrefixes;
|
|
|
|
private final Set<String> storedPathPrefixes;
|
|
|
|
|
|
|
|
|
|
|
|
BootZipCopyAction(File output, boolean preserveFileTimestamps,
|
|
|
|
BootZipCopyAction(File output, boolean preserveFileTimestamps,
|
|
|
|
Spec<FileTreeElement> requiresUnpack, LaunchScriptConfiguration launchScript,
|
|
|
|
Spec<FileTreeElement> requiresUnpack, Spec<FileTreeElement> exclusions,
|
|
|
|
Set<String> storedPathPrefixes) {
|
|
|
|
LaunchScriptConfiguration launchScript, Set<String> storedPathPrefixes) {
|
|
|
|
this.output = output;
|
|
|
|
this.output = output;
|
|
|
|
this.preserveFileTimestamps = preserveFileTimestamps;
|
|
|
|
this.preserveFileTimestamps = preserveFileTimestamps;
|
|
|
|
this.requiresUnpack = requiresUnpack;
|
|
|
|
this.requiresUnpack = requiresUnpack;
|
|
|
|
|
|
|
|
this.exclusions = exclusions;
|
|
|
|
this.launchScript = launchScript;
|
|
|
|
this.launchScript = launchScript;
|
|
|
|
this.storedPathPrefixes = storedPathPrefixes;
|
|
|
|
this.storedPathPrefixes = storedPathPrefixes;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -83,7 +86,7 @@ class BootZipCopyAction implements CopyAction {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
stream.process(new ZipStreamAction(zipStream, this.output,
|
|
|
|
stream.process(new ZipStreamAction(zipStream, this.output,
|
|
|
|
this.preserveFileTimestamps, this.requiresUnpack,
|
|
|
|
this.preserveFileTimestamps, this.requiresUnpack, this.exclusions,
|
|
|
|
this.storedPathPrefixes));
|
|
|
|
this.storedPathPrefixes));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
finally {
|
|
|
@ -148,20 +151,26 @@ class BootZipCopyAction implements CopyAction {
|
|
|
|
|
|
|
|
|
|
|
|
private final Spec<FileTreeElement> requiresUnpack;
|
|
|
|
private final Spec<FileTreeElement> requiresUnpack;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Spec<FileTreeElement> exclusions;
|
|
|
|
|
|
|
|
|
|
|
|
private final Set<String> storedPathPrefixes;
|
|
|
|
private final Set<String> storedPathPrefixes;
|
|
|
|
|
|
|
|
|
|
|
|
private ZipStreamAction(ZipOutputStream zipStream, File output,
|
|
|
|
private ZipStreamAction(ZipOutputStream zipStream, File output,
|
|
|
|
boolean preserveFileTimestamps, Spec<FileTreeElement> requiresUnpack,
|
|
|
|
boolean preserveFileTimestamps, Spec<FileTreeElement> requiresUnpack,
|
|
|
|
Set<String> storedPathPrefixes) {
|
|
|
|
Spec<FileTreeElement> exclusions, Set<String> storedPathPrefixes) {
|
|
|
|
this.zipStream = zipStream;
|
|
|
|
this.zipStream = zipStream;
|
|
|
|
this.output = output;
|
|
|
|
this.output = output;
|
|
|
|
this.preserveFileTimestamps = preserveFileTimestamps;
|
|
|
|
this.preserveFileTimestamps = preserveFileTimestamps;
|
|
|
|
this.requiresUnpack = requiresUnpack;
|
|
|
|
this.requiresUnpack = requiresUnpack;
|
|
|
|
|
|
|
|
this.exclusions = exclusions;
|
|
|
|
this.storedPathPrefixes = storedPathPrefixes;
|
|
|
|
this.storedPathPrefixes = storedPathPrefixes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void processFile(FileCopyDetailsInternal details) {
|
|
|
|
public void processFile(FileCopyDetailsInternal details) {
|
|
|
|
|
|
|
|
if (this.exclusions.isSatisfiedBy(details)) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (details.isDirectory()) {
|
|
|
|
if (details.isDirectory()) {
|
|
|
|
createDirectory(details);
|
|
|
|
createDirectory(details);
|
|
|
|