6 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
brian.long e3626bdbf8 v1.0.3 pom 2021-05-19 11:16:01 -04:00
brian.long 85dba196a0 Merge branch 'develop' into stable 2021-05-19 11:15:19 -04:00
brian.long 8ede035b2a using stream instead of reader 2021-05-19 11:15:08 -04:00
2 changed files with 14 additions and 11 deletions
+2 -2
View File
@@ -8,7 +8,7 @@
<groupId>com.inteligr8.alfresco</groupId>
<artifactId>amp-plugin</artifactId>
<version>1.0.2</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,9 +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;
@@ -92,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");
@@ -272,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();
@@ -298,13 +300,14 @@ public class AmpMojo extends AbstractMojo implements ArtifactResolutionCallback
zstream.putNextEntry(new ZipEntry(targetPath + file.getName()));
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();
}