You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tc...@apache.org on 2008/07/07 02:28:49 UTC
svn commit: r674372 [1/6] - in /commons/sandbox/compress/branches/redesign:
./ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/commons/
src/main/java/org/apache/commons/compress/ src/main/java/org/apa...
Author: tcurdt
Date: Sun Jul 6 17:28:46 2008
New Revision: 674372
URL: http://svn.apache.org/viewvc?rev=674372&view=rev
Log:
Merge branch 'master' of git://vafer.org/compress
Added:
commons/sandbox/compress/branches/redesign/.classpath
commons/sandbox/compress/branches/redesign/.gitignore
commons/sandbox/compress/branches/redesign/.project
commons/sandbox/compress/branches/redesign/LICENSE.txt
commons/sandbox/compress/branches/redesign/NOTICE.txt
commons/sandbox/compress/branches/redesign/checkstyle.xml
commons/sandbox/compress/branches/redesign/license-header.txt
commons/sandbox/compress/branches/redesign/maven.xml
commons/sandbox/compress/branches/redesign/pom.xml
commons/sandbox/compress/branches/redesign/project.properties
commons/sandbox/compress/branches/redesign/project.xml
commons/sandbox/compress/branches/redesign/src/
commons/sandbox/compress/branches/redesign/src/main/
commons/sandbox/compress/branches/redesign/src/main/java/
commons/sandbox/compress/branches/redesign/src/main/java/org/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/Change.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/ChangeSet.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/ChangeWorker.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/DeleteChange.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorException.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/gzip/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/utils/
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/utils/CompressUtils.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/utils/IOUtils.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/utils/ReflectionUtils.java
commons/sandbox/compress/branches/redesign/src/main/resources/
commons/sandbox/compress/branches/redesign/src/main/resources/bla.jar
commons/sandbox/compress/branches/redesign/src/main/resources/bla.tar
commons/sandbox/compress/branches/redesign/src/main/resources/bla.tgz
commons/sandbox/compress/branches/redesign/src/main/resources/bla.zip
commons/sandbox/compress/branches/redesign/src/main/resources/test1.xml
commons/sandbox/compress/branches/redesign/src/main/resources/test2.xml
commons/sandbox/compress/branches/redesign/src/site/
commons/sandbox/compress/branches/redesign/src/site/resources/
commons/sandbox/compress/branches/redesign/src/site/resources/images/
commons/sandbox/compress/branches/redesign/src/site/resources/images/compress-logo-white.png
commons/sandbox/compress/branches/redesign/src/site/resources/images/compress-logo-white.xcf
commons/sandbox/compress/branches/redesign/src/site/site.xml
commons/sandbox/compress/branches/redesign/src/site/xdoc/
commons/sandbox/compress/branches/redesign/src/site/xdoc/cvs-usage.xml
commons/sandbox/compress/branches/redesign/src/site/xdoc/downloads.xml
commons/sandbox/compress/branches/redesign/src/site/xdoc/images/
commons/sandbox/compress/branches/redesign/src/site/xdoc/images/compress-logo-white.png
commons/sandbox/compress/branches/redesign/src/site/xdoc/images/compress-logo-white.xcf
commons/sandbox/compress/branches/redesign/src/site/xdoc/index.xml
commons/sandbox/compress/branches/redesign/src/site/xdoc/issue-tracking.xml
commons/sandbox/compress/branches/redesign/src/site/xdoc/style/
commons/sandbox/compress/branches/redesign/src/site/xdoc/style/project.css
commons/sandbox/compress/branches/redesign/src/test/
commons/sandbox/compress/branches/redesign/src/test/java/
commons/sandbox/compress/branches/redesign/src/test/java/org/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/CompressTestCase.java
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/memory/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveTestCase.java
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/changes/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/changes/ChangeSetTestCase.java
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/changes/ChangeWorkerTest.java
commons/sandbox/compress/branches/redesign/src/test/resources/
commons/sandbox/compress/branches/redesign/src/test/resources/bla.ar
commons/sandbox/compress/branches/redesign/src/test/resources/bla.jar
commons/sandbox/compress/branches/redesign/src/test/resources/bla.tar
commons/sandbox/compress/branches/redesign/src/test/resources/bla.tgz
commons/sandbox/compress/branches/redesign/src/test/resources/bla.txt.bz2
commons/sandbox/compress/branches/redesign/src/test/resources/bla.xml.bz2
commons/sandbox/compress/branches/redesign/src/test/resources/bla.zip
commons/sandbox/compress/branches/redesign/src/test/resources/test.txt
commons/sandbox/compress/branches/redesign/src/test/resources/test1.xml
commons/sandbox/compress/branches/redesign/src/test/resources/test2.xml
Added: commons/sandbox/compress/branches/redesign/.classpath
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/.classpath?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/.classpath (added)
+++ commons/sandbox/compress/branches/redesign/.classpath Sun Jul 6 17:28:46 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="output" path="classes"/>
+</classpath>
Added: commons/sandbox/compress/branches/redesign/.gitignore
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/.gitignore?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/.gitignore (added)
+++ commons/sandbox/compress/branches/redesign/.gitignore Sun Jul 6 17:28:46 2008
@@ -0,0 +1,4 @@
+classes
+.classpath
+.project
+.settings
Added: commons/sandbox/compress/branches/redesign/.project
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/.project?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/.project (added)
+++ commons/sandbox/compress/branches/redesign/.project Sun Jul 6 17:28:46 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>compress-test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: commons/sandbox/compress/branches/redesign/LICENSE.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/LICENSE.txt?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/LICENSE.txt (added)
+++ commons/sandbox/compress/branches/redesign/LICENSE.txt Sun Jul 6 17:28:46 2008
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Added: commons/sandbox/compress/branches/redesign/NOTICE.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/NOTICE.txt?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/NOTICE.txt (added)
+++ commons/sandbox/compress/branches/redesign/NOTICE.txt Sun Jul 6 17:28:46 2008
@@ -0,0 +1,5 @@
+Apache Commons Compress
+Copyright 2002-2004 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
Added: commons/sandbox/compress/branches/redesign/checkstyle.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/checkstyle.xml?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/checkstyle.xml (added)
+++ commons/sandbox/compress/branches/redesign/checkstyle.xml Sun Jul 6 17:28:46 2008
@@ -0,0 +1,175 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+
+<!--
+ Checkstyle checks configured for Maven.
+-->
+
+<module name="Checker">
+
+ <!-- Checks that a package.html file exists for each package. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
+ <module name="PackageHtml"/>
+
+ <!-- Checks whether files end with a new line. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+ <module name="NewlineAtEndOfFile"/>
+
+ <!-- Checks that property files contain the same keys. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+ <module name="Translation"/>
+
+ <module name="TreeWalker">
+
+ <property name="cacheFile" value="${checkstyle.cache.file}"/>
+
+ <!-- ************************************************************** -->
+ <!-- Checks that are different from the sun coding conventions ones -->
+ <!-- ************************************************************** -->
+ <module name="Header">
+ <property name="headerFile" value="license-header.txt"/>
+ </module>
+ <property name="tabWidth" value="4"/>
+ <module name="LeftCurly">
+ <property name="option" value="eol"/>
+ </module>
+ <module name="RightCurly">
+ <property name="option" value="alone"/>
+ </module>
+ <module name="LineLength">
+ <property name="max" value="132"/>
+ </module>
+ <module name="MethodLength">
+ <property name="max" value="175"/>
+ </module>
+ <!-- No Paren pad check
+ <module name="ParenPad"/>
+ -->
+ <module name="ConstantName">
+ <property name="format" value="log|^[a-zA-Z][a-zA-Z0-9_]*$"/>
+ </module>
+
+ <!-- ************************************************************** -->
+ <!-- Default Sun coding conventions checks -->
+ <!-- ************************************************************** -->
+
+ <!-- Checks for Javadoc comments. -->
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+ <module name="JavadocMethod"/>
+ <module name="JavadocType"/>
+ <module name="JavadocVariable"/>
+
+
+ <!-- Checks for Naming Conventions. -->
+ <!-- See http://checkstyle.sf.net/config_naming.html -->
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+ <module name="MemberName"/>
+
+ <!-- Checks for imports -->
+ <!-- See http://checkstyle.sf.net/config_import.html -->
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+
+ <!-- Checks for Size Violations. -->
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->
+ <module name="FileLength"/>
+ <module name="ParameterNumber"/>
+
+
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <module name="EmptyForIteratorPad"/>
+ <module name="NoWhitespaceAfter"/>
+ <module name="NoWhitespaceBefore"/>
+ <module name="OperatorWrap"/>
+ <module name="TabCharacter"/>
+ <module name="WhitespaceAfter"/>
+ <module name="WhitespaceAround"/>
+
+
+ <!-- Modifier Checks -->
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+
+ <!-- Checks for blocks. You know, those {}'s -->
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock"/>
+
+ <module name="NeedBraces"/>
+
+
+ <!-- Checks for common coding problems -->
+ <!-- See http://checkstyle.sf.net/config_coding.html -->
+ <module name="AvoidInlineConditionals"/>
+ <module name="DoubleCheckedLocking"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="HiddenField"/>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows">
+ <property name="allowUnchecked" value="true"/> <!-- DISABLED -->
+ <property name="allowSubclasses" value="true"/> <!-- DISABLED -->
+ </module>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+
+ <!-- Checks for class design -->
+ <!-- See http://checkstyle.sf.net/config_design.html -->
+ <module name="DesignForExtension">
+ <property name="severity" value="ignore"/> <!-- DISABLED -->
+ </module>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="VisibilityModifier"/>
+
+
+ <!-- Miscellaneous other checks. -->
+ <!-- See http://checkstyle.sf.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <module name="FinalParameters">
+ <property name="severity" value="ignore"/> <!-- DISABLED -->
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Line has trailing spaces."/>
+ </module>
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+
+ </module>
+
+</module>
Added: commons/sandbox/compress/branches/redesign/license-header.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/license-header.txt?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/license-header.txt (added)
+++ commons/sandbox/compress/branches/redesign/license-header.txt Sun Jul 6 17:28:46 2008
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
\ No newline at end of file
Added: commons/sandbox/compress/branches/redesign/maven.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/maven.xml?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/maven.xml (added)
+++ commons/sandbox/compress/branches/redesign/maven.xml Sun Jul 6 17:28:46 2008
@@ -0,0 +1,84 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project default="java:jar"
+ xmlns:ant="jelly:ant"
+ xmlns:j="jelly:core">
+
+ <!-- ================================================================== -->
+ <!-- Copy into the binary distribution -->
+ <!-- ================================================================== -->
+ <postGoal name="dist:prepare-bin-filesystem">
+
+ <copy todir="${maven.dist.bin.assembly.dir}">
+ <fileset file='${basedir}/NOTICE.txt'/>
+ <fileset file="${basedir}/RELEASE-NOTES.txt"/>
+ </copy>
+
+ </postGoal>
+
+ <!-- ================================================================== -->
+ <!-- Copy into the source distribution -->
+ <!-- ================================================================== -->
+ <postGoal name="dist:prepare-src-filesystem">
+
+ <!-- Copy files -->
+ <copy todir="${maven.dist.src.assembly.dir}">
+ <fileset file='${basedir}/NOTICE.txt'/>
+ <fileset file="${basedir}/RELEASE-NOTES.txt"/>
+ <fileset file="${basedir}/checkstyle.xml"/>
+ </copy>
+
+ <!-- Copy xdoc directory -->
+ <copy todir="${maven.dist.src.assembly.dir}/xdocs">
+ <fileset dir="xdocs"/>
+ </copy>
+
+ </postGoal>
+
+ <!-- ================================================================== -->
+ <!-- Create MD5 Check Sums -->
+ <!-- ================================================================== -->
+ <postGoal name="dist">
+
+ <!-- create checksum for jar -->
+ <ant:checksum file="${maven.build.dir}/${maven.final.name}.jar" property="jar.md5"/>
+ <ant:echo message="${jar.md5} *${maven.final.name}.jar"
+ file="${maven.build.dir}/${maven.final.name}.jar.md5" />
+
+ <!-- create checksum for binary zip -->
+ <ant:checksum file="${maven.dist.dir}/${maven.final.name}.zip" property="zip.md5"/>
+ <ant:echo message="${zip.md5} *${maven.final.name}.zip"
+ file="${maven.dist.dir}/${maven.final.name}.zip.md5" />
+
+ <!-- create checksum for binary tar.gz -->
+ <ant:checksum file="${maven.dist.dir}/${maven.final.name}.tar.gz" property="tar.gz.md5"/>
+ <ant:echo message="${tar.gz.md5} *${maven.final.name}.tar.gz"
+ file="${maven.dist.dir}/${maven.final.name}.tar.gz.md5" />
+
+ <!-- create checksum for source zip -->
+ <ant:checksum file="${maven.dist.dir}/${maven.final.name}-src.zip" property="src.zip.md5"/>
+ <ant:echo message="${src.zip.md5} *${maven.final.name}-src.zip"
+ file="${maven.dist.dir}/${maven.final.name}-src.zip.md5" />
+
+ <!-- create checksum for source tar.gz -->
+ <ant:checksum file="${maven.dist.dir}/${maven.final.name}-src.tar.gz" property="src.tar.gz.md5"/>
+ <ant:echo message="${src.tar.gz.md5} *${maven.final.name}-src.tar.gz"
+ file="${maven.dist.dir}/${maven.final.name}-src.tar.gz.md5" />
+
+ </postGoal>
+
+</project>
Added: commons/sandbox/compress/branches/redesign/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/pom.xml?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/pom.xml (added)
+++ commons/sandbox/compress/branches/redesign/pom.xml Sun Jul 6 17:28:46 2008
@@ -0,0 +1,107 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-sandbox-parent</artifactId>
+ <version>4</version>
+ </parent>
+
+ <artifactId>commons-compress</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Commons Compress (Sandbox)</name>
+ <url>http://commons.apache.org/sandbox/compress/</url>
+ <description>Commons Compress is a component that contains Tar, Zip and BZip2 packages</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <developers>
+ <developer>
+ <!-- In that I moved them to their new location -->
+ <name>Henri Yandell</name>
+ <id>bayard</id>
+ <email>bayard@apache.org</email>
+ <organization></organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Dirk Verbeeck</name>
+ <id>dirkv</id>
+ <email></email>
+ <organization></organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/commons/sandbox/compress/trunk</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/sandbox/compress/trunk</developerConnection>
+ <url>http://svn.apache.org/repos/asf/commons/sandbox/compress/trunk</url>
+ </scm>
+
+ <distributionManagement>
+ <site>
+ <id>website</id>
+ <name>Apache Website</name>
+ <url>scp://people.apache.org/www/commons.apache.org/sandbox/compress/</url>
+ </site>
+ </distributionManagement>
+
+ <properties>
+ <commons.componentid>compress</commons.componentid>
+ <commons.jira.componentid>12311183</commons.jira.componentid>
+ </properties>
+
+ <build>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <testSourceDirectory>src/test/test</testSourceDirectory>
+
+ <!-- turn off cobertura until we figure out why it's hanging -->
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <configuration>
+ <instrumentation>
+ <excludes>
+ <exclude>org/apache/commons/compress/bzip2/**/*.class</exclude>
+ <exclude>org/apache/commons/compress/compressors/bzip2/**/*.class</exclude>
+ </excludes>
+ </instrumentation>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>checkstyle.xml</configLocation>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Added: commons/sandbox/compress/branches/redesign/project.properties
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/project.properties?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/project.properties (added)
+++ commons/sandbox/compress/branches/redesign/project.properties Sun Jul 6 17:28:46 2008
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+maven.repo.remote=http://repo1.maven.org/maven
+
+maven.xdoc.jsl=../commons-build/commons-site.jsl
+maven.xdoc.date=bottom
+maven.xdoc.poweredby.image=maven-feather.png
+maven.xdoc.version=${pom.currentVersion}
+maven.xdoc.developmentProcessUrl=http://commons.apache.org/charter.html
+maven.xdoc.includeProjectDocumentation=yes
+
+maven.checkstyle.properties = checkstyle.xml
+
+# Compile targets
+maven.compile.source=1.4
+maven.compile.target=1.4
+
+# Jar Manifest Additional Attributes
+maven.jar.manifest.attributes.list=Implementation-Vendor-Id,X-Compile-Source-JDK,X-Compile-Target-JDK
+maven.jar.manifest.attribute.Implementation-Vendor-Id=org.apache
+maven.jar.manifest.attribute.X-Compile-Source-JDK=${maven.compile.source}
+maven.jar.manifest.attribute.X-Compile-Target-JDK=${maven.compile.target}
+
+# uncomment the next line to work in offline mode (no jar download & no linkcheck)
+#maven.mode.online=
+maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory
+
+maven.javadoc.author=false
+maven.javadoc.links=http://java.sun.com/products/jdk/1.4/docs/api,http://commons.apache.org/dbcp/apidocs
+
+maven.compile.debug=on
+maven.compile.deprecation=off
+maven.compile.optimize=off
+
+maven.jarResources.basedir=src/java
+maven.jar.excludes=**/package.html
+maven.junit.fork=true
+maven.junit.sysproperties=org.xml.sax.driver
+org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
+
+clover.excludes=**/Test*.java
Added: commons/sandbox/compress/branches/redesign/project.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/project.xml?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/project.xml (added)
+++ commons/sandbox/compress/branches/redesign/project.xml Sun Jul 6 17:28:46 2008
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project>
+ <extend>../commons-build/sandbox-project.xml</extend>
+ <name>Commons Compress</name>
+ <id>commons-compress</id>
+ <logo>/images/compress-logo-white.png</logo>
+ <inceptionYear>2002</inceptionYear>
+ <shortDescription>Commons Compress</shortDescription>
+ <description>
+ Commons Compress is a component that contains Tar, Zip and BZip2 packages.
+ </description>
+ <currentVersion>0.1-dev</currentVersion>
+ <issueTrackingUrl>http://issues.apache.org/bugzilla/</issueTrackingUrl>
+ <siteAddress>cvs.apache.org</siteAddress>
+ <logo></logo>
+
+ <versions>
+ </versions>
+ <branches>
+ </branches>
+
+ <developers>
+ <developer>
+ <!-- In that I moved them to their new location -->
+ <name>Henri Yandell</name>
+ <id>bayard</id>
+ <email>bayard@apache.org</email>
+ <organization></organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Dirk Verbeeck</name>
+ <id>dirkv</id>
+ <email></email>
+ <organization></organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <dependencies>
+ <dependency>
+ <id>junit</id>
+ <version>3.8.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <unitTest>
+ <includes>
+ <include>**/*Test*</include>
+ </includes>
+ </unitTest>
+ </build>
+</project>
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+/**
+ * Represents an entry of an archive.
+ */
+public interface ArchiveEntry {
+ /**
+ * Returns the name of this entry.
+ * @return the name of this entry
+ */
+ public String getName();
+
+ public long getSize();
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveException.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+/**
+ * Archiver related Exception
+ */
+public class ArchiveException extends Exception {
+
+ private static final long serialVersionUID = 3256440322136748848L;
+
+ public ArchiveException() {
+ super();
+ }
+
+ public ArchiveException(String message) {
+ super(message);
+ }
+
+ public ArchiveException(String message, Exception e) {
+ super(message);
+ this.initCause(e);
+ }
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public abstract class ArchiveInputStream extends InputStream {
+ /**
+ * Returns the next Archive Entry in this Stream.
+ * @return the next entry
+ * @throws IOException if the next entry could not be read
+ */
+ public abstract ArchiveEntry getNextEntry() throws IOException;
+
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+public abstract class ArchiveOutputStream extends OutputStream {
+
+ public abstract void putArchiveEntry(ArchiveEntry entry) throws IOException;
+
+ public abstract void closeArchiveEntry() throws IOException;
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.compress.archivers.ar.ArArchiveInputStream;
+import org.apache.commons.compress.archivers.ar.ArArchiveOutputStream;
+import org.apache.commons.compress.archivers.jar.JarArchiveInputStream;
+import org.apache.commons.compress.archivers.jar.JarArchiveOutputStream;
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
+import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
+import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
+import org.apache.commons.compress.utils.ReflectionUtils;
+
+public class ArchiveStreamFactory {
+
+ final Map inputStreamClasses = new HashMap();
+ final Map outputStreamClasses = new HashMap();
+
+ public ArchiveStreamFactory() throws ArchiveException {
+ registerArchiveInputStream("zip", ZipArchiveInputStream.class);
+ registerArchiveOutputStream("zip", ZipArchiveOutputStream.class);
+
+ registerArchiveInputStream("tar", TarArchiveInputStream.class);
+ registerArchiveOutputStream("tar", TarArchiveOutputStream.class);
+
+ registerArchiveInputStream("ar", ArArchiveInputStream.class);
+ registerArchiveOutputStream("ar", ArArchiveOutputStream.class);
+
+ registerArchiveInputStream("jar", JarArchiveInputStream.class);
+ registerArchiveOutputStream("jar", JarArchiveOutputStream.class);
+ }
+
+
+ public void registerArchiveInputStream( final String name, final Class stream ) throws ArchiveException {
+ if (ArchiveInputStream.class.isAssignableFrom(stream) && !(stream.isInterface())) {
+ inputStreamClasses.put(name, stream);
+ } else {
+ throw new ArchiveException("Archive does not implement the ArchiveInputStream interface.");
+ }
+ }
+
+ public void registerArchiveOutputStream( final String name, final Class stream ) throws ArchiveException {
+ ReflectionUtils.registerClazz(outputStreamClasses, name, ArchiveOutputStream.class, stream);
+ if (ArchiveOutputStream.class.isAssignableFrom(stream) && !(stream.isInterface())) {
+ outputStreamClasses.put(name, stream);
+ } else {
+ throw new ArchiveException("Archive does not implement the ArchiveOutputStream interface.");
+ }
+ }
+
+ public ArchiveInputStream createArchiveInputStream( final String archiverName, final InputStream out ) throws ArchiveException {
+ try {
+ final Class clazz = (Class) inputStreamClasses.get(archiverName);
+
+ if (clazz == null) {
+ throw new ArchiveException("ArchiverFactory could not create instance");
+ }
+
+ final Class[] params = { InputStream.class };
+ final Constructor constructor = clazz.getConstructor(params);
+ final Object[] initargs = { out };
+ return (ArchiveInputStream) constructor.newInstance(initargs);
+ } catch (InstantiationException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (IllegalAccessException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (SecurityException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (NoSuchMethodException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (IllegalArgumentException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (InvocationTargetException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ }
+ }
+
+ public ArchiveOutputStream createArchiveOutputStream( final String archiverName, final OutputStream out ) throws ArchiveException {
+ try {
+ final Class clazz = (Class) outputStreamClasses.get(archiverName);
+
+ if (clazz == null) {
+ throw new ArchiveException("ArchiverFactory could not create instance");
+ }
+
+ final Class[] params = { OutputStream.class };
+ final Constructor constructor = clazz.getConstructor(params);
+ final Object[] initargs = { out };
+ return (ArchiveOutputStream) constructor.newInstance(initargs);
+ } catch (InstantiationException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (IllegalAccessException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (SecurityException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (NoSuchMethodException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (IllegalArgumentException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ } catch (InvocationTargetException e) {
+ throw new ArchiveException("ArchiverFactory could not create instance", e);
+ }
+ }
+
+ public ArchiveInputStream createArchiveInputStream( final InputStream input ) throws IOException {
+
+ final byte[] signature = new byte[12];
+ input.mark(signature.length);
+ input.read(signature);
+ // reset not supported exception?
+ input.reset();
+
+// for (int i = 0; i < signature.length; i++) {
+// System.out.print(Integer.toHexString(signature[i]));
+// System.out.print(",");
+// }
+// System.out.println("");
+
+ for (Iterator it = inputStreamClasses.values().iterator(); it.hasNext();) {
+ final Class clazz = (Class) it.next();
+ try {
+ final Method method = clazz.getMethod("matches", new Class[] { byte[].class });
+
+ final Object result = method.invoke(null, new Object[] { signature } );
+
+ if (result.equals(Boolean.TRUE)) {
+ final Class[] params = { InputStream.class };
+ final Constructor constructor = clazz.getConstructor(params);
+ final Object[] initargs = { input };
+ return (ArchiveInputStream) constructor.newInstance(initargs);
+ }
+ } catch (SecurityException e) {
+ } catch (NoSuchMethodException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException e) {
+ } catch (InvocationTargetException e) {
+ } catch (InstantiationException e) {
+ }
+ }
+ return null;
+ }
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers.ar;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+
+public class ArArchiveEntry implements ArchiveEntry {
+
+ private final String name;
+ private int userId;
+ private int groupId;
+ private int mode;
+ private long lastModified;
+ private long length;
+
+ public ArArchiveEntry(String name, long length) {
+ this(name, length, 0, 0, 33188, System.currentTimeMillis());
+ }
+
+ public ArArchiveEntry(String name, long length, int userId, int groupId, int mode, long lastModified) {
+ this.name = name;
+ this.length = length;
+ this.userId = userId;
+ this.groupId = groupId;
+ this.mode = mode;
+ this.lastModified = lastModified;
+ }
+
+ public long getSize() {
+ return this.getLength();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getUserId() {
+ return userId;
+ }
+
+ public int getGroupId() {
+ return groupId;
+ }
+
+ public int getMode() {
+ return mode;
+ }
+
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ public long getLength() {
+ return length;
+ }
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers.ar;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.ArchiveInputStream;
+
+public class ArArchiveInputStream extends ArchiveInputStream {
+
+ private final InputStream input;
+ private long offset = 0;
+
+ public ArArchiveInputStream( final InputStream pInput ) {
+ input = pInput;
+ }
+
+ public ArchiveEntry getNextEntry() throws IOException {
+
+ if (offset == 0) {
+ final byte[] expected = "!<arch>\n".getBytes();
+ final byte[] realized = new byte[expected.length];
+ final int read = input.read(realized);
+ if (read != expected.length) {
+ throw new IOException("failed to read header");
+ }
+ for (int i = 0; i < expected.length; i++) {
+ if (expected[i] != realized[i]) {
+ throw new IOException("invalid header " + new String(realized));
+ }
+ }
+ }
+
+ if (input.available() == 0) {
+ return null;
+ }
+
+ if (offset % 2 != 0) {
+ read();
+ }
+
+ final byte[] name = new byte[16];
+ final byte[] lastmodified = new byte[12];
+ final byte[] userid = new byte[6];
+ final byte[] groupid = new byte[6];
+ final byte[] filemode = new byte[8];
+ final byte[] length = new byte[10];
+
+ read(name);
+ read(lastmodified);
+ read(userid);
+ read(groupid);
+ read(filemode);
+ read(length);
+
+ {
+ final byte[] expected = "`\012".getBytes();
+ final byte[] realized = new byte[expected.length];
+ final int read = input.read(realized);
+ if (read != expected.length) {
+ throw new IOException("failed to read entry header");
+ }
+ for (int i = 0; i < expected.length; i++) {
+ if (expected[i] != realized[i]) {
+ throw new IOException("invalid entry header. not read the content?");
+ }
+ }
+ }
+
+ return new ArArchiveEntry(new String(name).trim(), Long.parseLong(new String(length).trim()));
+
+ }
+
+
+ public int read() throws IOException {
+ final int ret = input.read();
+ offset++;
+ return ret;
+ }
+
+ public int read(byte[] b, int off, int len) throws IOException {
+ return this.input.read(b, off, len);
+ }
+
+ public static boolean matches( byte[] signature ) {
+ // 3c21 7261 6863 0a3e
+
+ if (signature[0] != 0x21) {
+ return false;
+ }
+ if (signature[1] != 0x3c) {
+ return false;
+ }
+ if (signature[2] != 0x61) {
+ return false;
+ }
+ if (signature[3] != 0x72) {
+ return false;
+ }
+ if (signature[4] != 0x63) {
+ return false;
+ }
+ if (signature[5] != 0x68) {
+ return false;
+ }
+ if (signature[6] != 0x3e) {
+ return false;
+ }
+ if (signature[7] != 0x0a) {
+ return false;
+ }
+
+ return true;
+ }
+
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers.ar;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.ArchiveOutputStream;
+
+public class ArArchiveOutputStream extends ArchiveOutputStream {
+
+ private final OutputStream out;
+ private long archiveOffset = 0;
+ private long entryOffset = 0;
+ private ArArchiveEntry prevEntry;
+
+ public ArArchiveOutputStream( final OutputStream pOut ) {
+ out = pOut;
+
+ }
+
+ private long writeArchiveHeader() throws IOException {
+ final String header = "!<arch>\n";
+ out.write(header.getBytes());
+ return header.length();
+ }
+
+ public void closeArchiveEntry() throws IOException {
+ if ((entryOffset % 2) != 0) {
+ write('\n');
+ archiveOffset++;
+ }
+ }
+
+ public void putArchiveEntry( final ArchiveEntry pEntry ) throws IOException {
+ ArArchiveEntry pArEntry = (ArArchiveEntry)pEntry;
+ if (prevEntry == null) {
+ archiveOffset += writeArchiveHeader();
+ } else {
+ if (prevEntry.getLength() != entryOffset) {
+ throw new IOException("length does not match entry (" + prevEntry.getLength() + " != " + entryOffset);
+ }
+
+ closeArchiveEntry();
+ }
+
+ prevEntry = pArEntry;
+
+ archiveOffset += writeEntryHeader(pArEntry);
+
+ entryOffset = 0;
+ }
+
+ private long fill( final long pOffset, final long pNewOffset, final char pFill ) throws IOException {
+ final long diff = pNewOffset - pOffset;
+
+ if (diff > 0) {
+ for (int i = 0; i < diff; i++) {
+ write(pFill);
+ }
+ }
+
+ return pNewOffset;
+ }
+
+ private long write( final String data ) throws IOException {
+ final byte[] bytes = data.getBytes("ascii");
+ write(bytes);
+ return bytes.length;
+ }
+
+ private long writeEntryHeader( final ArArchiveEntry pEntry ) throws IOException {
+
+ long offset = 0;
+
+ final String n = pEntry.getName();
+ if (n.length() > 16) {
+ throw new IOException("filename too long");
+ }
+ offset += write(n);
+
+ offset = fill(offset, 16, ' ');
+ final String m = "" + (pEntry.getLastModified() / 1000);
+ if (m.length() > 12) {
+ throw new IOException("modified too long");
+ }
+ offset += write(m);
+
+ offset = fill(offset, 28, ' ');
+ final String u = "" + pEntry.getUserId();
+ if (u.length() > 6) {
+ throw new IOException("userid too long");
+ }
+ offset += write(u);
+
+ offset = fill(offset, 34, ' ');
+ final String g = "" + pEntry.getGroupId();
+ if (g.length() > 6) {
+ throw new IOException("groupid too long");
+ }
+ offset += write(g);
+
+ offset = fill(offset, 40, ' ');
+ final String fm = "" + Integer.toString(pEntry.getMode(), 8);
+ if (fm.length() > 8) {
+ throw new IOException("filemode too long");
+ }
+ offset += write(fm);
+
+ offset = fill(offset, 48, ' ');
+ final String s = "" + pEntry.getLength();
+ if (s.length() > 10) {
+ throw new IOException("size too long");
+ }
+ offset += write(s);
+
+ offset = fill(offset, 58, ' ');
+
+ offset += write("`\012");
+
+ return offset;
+ }
+
+ public void write(int b) throws IOException {
+ out.write(b);
+ entryOffset++;
+ }
+
+ public void write(byte[] b, int off, int len) throws IOException {
+ out.write(b, off, len);
+ entryOffset += len;
+ }
+
+ public void write(byte[] b) throws IOException {
+ out.write(b);
+ entryOffset += b.length;
+ }
+
+ public void close() throws IOException {
+ closeArchiveEntry();
+ out.close();
+ prevEntry = null;
+ }
+
+ public String getDefaultFileExtension() {
+ return "ar";
+ }
+
+ public byte[] getHeader() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getName() {
+ return "ar";
+ }
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers.jar;
+
+import java.security.cert.Certificate;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+
+public class JarArchiveEntry extends ZipArchiveEntry implements ArchiveEntry {
+
+ private Attributes manifestAttributes = null;
+ private Certificate[] certificates = null;
+
+ public JarArchiveEntry(ZipEntry entry) throws ZipException {
+ super(entry);
+ }
+
+ public JarArchiveEntry(String name) {
+ super(name);
+ }
+
+ public JarArchiveEntry(ZipArchiveEntry entry) throws ZipException {
+ super(entry);
+ }
+
+ public JarArchiveEntry(JarEntry entry) throws ZipException {
+ super(entry);
+
+ }
+
+ public Attributes getManifestAttributes() {
+ return manifestAttributes;
+ }
+
+ public Certificate[] getCertificates() {
+ return certificates;
+ }
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers.jar;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
+
+public class JarArchiveInputStream extends ZipArchiveInputStream {
+
+ public JarArchiveInputStream( final InputStream inputStream ) throws IOException {
+ super(inputStream);
+ }
+
+ public ArchiveEntry getNextEntry() throws IOException {
+ return (ArchiveEntry)new JarArchiveEntry((ZipArchiveEntry)super.getNextEntry());
+ }
+
+ public static boolean matches( byte[] signature ) {
+ // 4b50 0403 0014 0008
+
+ if (signature[0] != 0x50) {
+ return false;
+ }
+ if (signature[1] != 0x4b) {
+ return false;
+ }
+ if (signature[2] != 0x03) {
+ return false;
+ }
+ if (signature[3] != 0x04) {
+ return false;
+ }
+ if (signature[4] != 0x14) {
+ return false;
+ }
+ if (signature[5] != 0x00) {
+ return false;
+ }
+ if (signature[6] != 0x08) {
+ return false;
+ }
+ if (signature[7] != 0x00) {
+ return false;
+ }
+
+ return true;
+ }
+}
Added: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java?rev=674372&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java (added)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java Sun Jul 6 17:28:46 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers.jar;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
+
+public class JarArchiveOutputStream extends ZipArchiveOutputStream {
+
+ public JarArchiveOutputStream( final OutputStream out ) {
+ super(out);
+ }
+
+ public void putArchiveEntry(ArchiveEntry entry) throws IOException {
+ // TODO special jar stuff
+ super.putArchiveEntry((ZipArchiveEntry) entry);
+ }
+}