On Tue, May 2, 2017 at 3:38 PM, Bindul Bhowmik <bindulbhow...@gmail.com> wrote:
> On Tue, May 2, 2017 at 1:22 PM, <ggreg...@apache.org> wrote: > > Repository: commons-compress > > Updated Branches: > > refs/heads/master 932d4f899 -> a793612b9 > > > > > > [COMPRESS-392] Add Brotli decoder based on the Google Brotli library. > > > > Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo > > Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/ > commit/a793612b > > Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/ > tree/a793612b > > Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/ > diff/a793612b > > > > Branch: refs/heads/master > > Commit: a793612b9e09795feb253aab9a738bd1f7280700 > > Parents: 932d4f8 > > Author: Philippe Mouawad <p.moua...@ubik-ingenierie.com> > > Authored: Tue May 2 12:22:04 2017 -0700 > > Committer: Gary Gregory <garydgreg...@gmail.com> > > Committed: Tue May 2 12:22:04 2017 -0700 > > > > ---------------------------------------------------------------------- > > pom.xml | 7 ++++++ > > src/changes/changes.xml | 3 +++ > > .../compressors/CompressorStreamFactory.java | 25 > +++++++++++++++++++- > > 3 files changed, 34 insertions(+), 1 deletion(-) > > ---------------------------------------------------------------------- > > > > > > http://git-wip-us.apache.org/repos/asf/commons-compress/ > blob/a793612b/pom.xml > > ---------------------------------------------------------------------- > > diff --git a/pom.xml b/pom.xml > > index 9745d1b..4cc629a 100644 > > --- a/pom.xml > > +++ b/pom.xml > > @@ -68,6 +68,12 @@ jar, tar, zip, dump, 7z, arj. > > <scope>test</scope> > > </dependency> > > <dependency> > > + <groupId>org.brotli</groupId> > > + <artifactId>dec</artifactId> > > + <version>0.1.1</version> > > + <optional>true</optional> > > + </dependency> > > + <dependency> > > <groupId>org.tukaani</groupId> > > <artifactId>xz</artifactId> > > <version>1.6</version> > > @@ -245,6 +251,7 @@ jar, tar, zip, dump, 7z, arj. > > <configuration> > > <instructions> > > <Import-Package>org.tukaani.xz;resolution:=optional</ > Import-Package> > > + <Import-Package>org.brotli.dec;resolution:=optional</ > Import-Package> > > </instructions> > > </configuration> > > </plugin> > > > > http://git-wip-us.apache.org/repos/asf/commons-compress/ > blob/a793612b/src/changes/changes.xml > > ---------------------------------------------------------------------- > > diff --git a/src/changes/changes.xml b/src/changes/changes.xml > > index d40a1a8..acd06f0 100644 > > --- a/src/changes/changes.xml > > +++ b/src/changes/changes.xml > > @@ -103,6 +103,9 @@ The <action> type attribute can be > add,update,fix,remove. > > Internal location pointer in ZipFile could get incremented > > even if nothing had been read. > > </action> > > + <action issue="COMPRESS-392" type="add" date="2017-05-02" > due-to="Philippe Mouawad"> > > + Add Brotli decoder based on the Google Brotli library. > > + </action> > > </release> > > <release version="1.13" date="2016-12-29" > > description="Release 1.13 - API compatible to 1.12 but > requires Java 7 at runtime."> > > > > http://git-wip-us.apache.org/repos/asf/commons-compress/ > blob/a793612b/src/main/java/org/apache/commons/compress/compressors/ > CompressorStreamFactory.java > > ---------------------------------------------------------------------- > > diff --git > > a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java > b/src/main/java/org/apache/commons/compress/compressors/ > CompressorStreamFactory.java > > index b12fc1a..29cf0cf 100644 > > --- a/src/main/java/org/apache/commons/compress/compressors/ > CompressorStreamFactory.java > > +++ b/src/main/java/org/apache/commons/compress/compressors/ > CompressorStreamFactory.java > > @@ -31,6 +31,8 @@ import java.util.Set; > > import java.util.SortedMap; > > import java.util.TreeMap; > > > > +import org.apache.commons.compress.compressors.brotli. > BrotliCompressorInputStream; > > +import org.apache.commons.compress.compressors.brotli.BrotliUtils; > > import org.apache.commons.compress.compressors.bzip2. > BZip2CompressorInputStream; > > import org.apache.commons.compress.compressors.bzip2. > BZip2CompressorOutputStream; > > import org.apache.commons.compress.compressors.deflate. > DeflateCompressorInputStream; > > @@ -93,6 +95,16 @@ public class CompressorStreamFactory implements > CompressorStreamProvider { > > > > private static final CompressorStreamFactory SINGLETON = new > CompressorStreamFactory(); > > > > + > > + > > + /** > > + * Constant (value {@value}) used to identify the BROTLI compression > > + * algorithm. > > + * > > + * @since 1.1 > > + */ > > + public static final String BROTLI = "br"; > > Gary, > > Shouldn't the @since value be 1.14 here? > Yes, good catch. Fixed in git master. Thank you for the review. Gary > > Bindul > > > + > > /** > > * Constant (value {@value}) used to identify the BZIP2 compression > > * algorithm. > > @@ -263,6 +275,10 @@ public class CompressorStreamFactory implements > CompressorStreamProvider { > > private static ArrayList<CompressorStreamProvider> > findCompressorStreamProviders() { > > return Lists.newArrayList(serviceLoaderIterator()); > > } > > + > > + public static String getBrotli() { > > + return BROTLI; > > + } > > > > public static String getBzip2() { > > return BZIP2; > > @@ -524,6 +540,13 @@ public class CompressorStreamFactory implements > CompressorStreamProvider { > > if (BZIP2.equalsIgnoreCase(name)) { > > return new BZip2CompressorInputStream(in, > actualDecompressConcatenated); > > } > > + > > + if (BROTLI.equalsIgnoreCase(name)) { > > + if (!BrotliUtils.isBrotliCompressionAvailable()) { > > + throw new CompressorException("Brotli compression > is not available."); > > + } > > + return new BrotliCompressorInputStream(in); > > + } > > > > if (XZ.equalsIgnoreCase(name)) { > > if (!XZUtils.isXZCompressionAvailable()) { > > @@ -677,7 +700,7 @@ public class CompressorStreamFactory implements > CompressorStreamProvider { > > > > @Override > > public Set<String> getInputStreamCompressorNames() { > > - return Sets.newHashSet(GZIP, BZIP2, XZ, LZMA, PACK200, DEFLATE, > SNAPPY_RAW, SNAPPY_FRAMED, Z, LZ4_BLOCK, > > + return Sets.newHashSet(GZIP, BROTLI, BZIP2, XZ, LZMA, PACK200, > DEFLATE, SNAPPY_RAW, SNAPPY_FRAMED, Z, LZ4_BLOCK, > > LZ4_FRAMED); > > } > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > -- E-Mail: garydgreg...@gmail.com | ggreg...@apache.org Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory