Skip to content

Commit

Permalink
Change project groupId to io.github.tsabirgaliev, setup maven infra…
Browse files Browse the repository at this point in the history
…sructure boilerplate
  • Loading branch information
tsabirgaliev committed Mar 20, 2017
1 parent 82770d9 commit 54cf3ab
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 13 deletions.
105 changes: 102 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,46 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.tair</groupId>
<groupId>io.github.tsabirgaliev</groupId>
<artifactId>zip</artifactId>
<version>1.0.0-Beta2</version>
<version>1.0.0.Beta3</version>

<name>Lazy streaming zip</name>
<description>
The Java JDK includes various means of creating/consuming compressed files.
What is missing is easy way of creating lazy streamed zip archive, in spirit
of java.util.zip.DeflaterInputStream.

This implementation relies on the fact that the PKZIP specification allows
archiving data streams of sizes not known upfront. This implies that the
archives produced will be readable only by tools aware of this trick.
Notably, java.util.zip.ZipInputStream is OK with that, so we use it to
test compatibility.
</description>
<url>https://github.com/tsabirgaliev/zip</url>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>tair</id>
<name>Tair Sabirgaliev</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/tsabirgaliev/zip.git</connection>
<developerConnection>scm:git:https://github.com/tsabirgaliev/zip.git</developerConnection>
<tag>1.0.0.Beta3</tag>
<url>https://github.com/tsabirgaliev/zip</url>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -36,16 +73,78 @@
</dependency>
</dependencies>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test compatibility.
ZipperInputStream lzis = new ZipperInputStream(...);
----

See more detailed example in `io.tair.zip.ZipperInputStreamTest`
See more detailed example in `io.github.tsabirgaliev.ZipperInputStreamTest`

== TODO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.tair.zip;
package io.github.tsabirgaliev;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -104,9 +104,9 @@ static class LocalFileHeader {
long compression_method = 8; // DEFLATE

static byte[] currentDosTime(Calendar cal) {
int result = cal.get(Calendar.HOUR_OF_DAY) * 2048
+ cal.get(Calendar.MINUTE) * 32
+ cal.get(Calendar.SECOND) / 2;
int result = (cal.get(Calendar.HOUR_OF_DAY) << 11)
| (cal.get(Calendar.MINUTE) << 5)
| (cal.get(Calendar.SECOND) / 2);

return new byte[] {
(byte)(result >> 0),
Expand All @@ -115,9 +115,9 @@ static byte[] currentDosTime(Calendar cal) {
}

static byte[] currentDosDate(Calendar cal) {
int result = (cal.get(Calendar.YEAR) - 1980) * 512
+ (cal.get(Calendar.MONTH) + 1) * 32
+ cal.get(Calendar.DATE);
int result = ((cal.get(Calendar.YEAR) - 1980) << 9)
| ((cal.get(Calendar.MONTH) + 1) << 5)
| cal.get(Calendar.DATE);

return new byte[] {
(byte)(result >> 0),
Expand All @@ -129,7 +129,7 @@ static byte[] currentDosDate(Calendar cal) {
, modification_date = currentDosDate(Calendar.getInstance())
;

long crc32_checksum = 0
final long crc32_checksum = 0
, compressed_size = 0
, uncompressed_size = 0
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.tair.zip;
package io.github.tsabirgaliev;

import org.apache.commons.io.IOUtils;

Expand Down

0 comments on commit 54cf3ab

Please sign in to comment.