3 Commits
Author SHA1 Message Date
brian.long 7038122a2c v1.0.4 pom 2021-05-19 16:15:01 -04:00
brian.long d0cb229d81 Merge branch 'develop' into stable 2021-05-19 16:14:26 -04:00
brian.long dec44cf623 fixed zip streaming 2021-05-19 16:14:12 -04:00
2 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -8,7 +8,7 @@
<groupId>com.inteligr8.alfresco</groupId>
<artifactId>amp-plugin</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<packaging>maven-plugin</packaging>
<name>A Maven plugin to generate AMP files</name>
@@ -91,7 +91,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<configuration>
<goalPrefix>amp</goalPrefix>
</configuration>
@@ -1,10 +1,10 @@
package com.inteligr8.alfresco.amp;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
@@ -93,7 +93,7 @@ public class AmpMojo extends AbstractMojo implements ArtifactResolutionCallback
public void execute() throws MojoExecutionException {
if (this.skip) {
this.getLog().debug("Skipped AMP packaging");
this.getLog().debug("Skipped AMP package");
return;
}
this.getLog().debug("Executing AMP packaging");
@@ -273,11 +273,12 @@ public class AmpMojo extends AbstractMojo implements ArtifactResolutionCallback
zstream.putNextEntry(new ZipEntry(filename));
File file = new File(directory, filename);
FileReader freader = new FileReader(file);
FileInputStream fistream = new FileInputStream(file);
BufferedInputStream bistream = new BufferedInputStream(fistream, this.streamBufferSize);
try {
IOUtil.copy(freader, zstream);
IOUtil.copy(bistream, zstream);
} finally {
freader.close();
bistream.close();
}
zstream.closeEntry();
@@ -300,13 +301,13 @@ public class AmpMojo extends AbstractMojo implements ArtifactResolutionCallback
zstream.putNextEntry(new ZipEntry(targetPath + file.getName()));
FileInputStream fistream = new FileInputStream(file);
BufferedInputStream bistream = new BufferedInputStream(fistream, this.streamBufferSize);
try {
IOUtil.copy(fistream, zstream);
IOUtil.copy(bistream, zstream);
} finally {
fistream.close();
bistream.close();
}
zstream.flush();
zstream.closeEntry();
}