This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.0.4-incubator in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git
commit 9fbe62f32cd2695b7c66c76f06aa839cc073d51a Author: Carsten Ziegeler <[email protected]> AuthorDate: Mon Jun 23 11:56:25 2008 +0000 Use released versions. git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/jcr/contentloader@670527 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 10 +-- .../jcr/contentloader/internal/ZipReader.java | 76 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 3705a01..cc17851 100644 --- a/pom.xml +++ b/pom.xml @@ -92,27 +92,27 @@ <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.jcr.api</artifactId> - <version>2.0.3-incubator-SNAPSHOT</version> + <version>2.0.2-incubator</version> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.commons.json</artifactId> - <version>2.0.3-incubator-SNAPSHOT</version> + <version>2.0.2-incubator</version> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.commons.mime</artifactId> - <version>2.0.3-incubator-SNAPSHOT</version> + <version>2.0.2-incubator</version> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.commons.osgi</artifactId> - <version>2.0.3-incubator-SNAPSHOT</version> + <version>2.0.2-incubator</version> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.engine</artifactId> - <version>2.0.3-incubator-SNAPSHOT</version> + <version>2.0.2-incubator</version> </dependency> <dependency> <groupId>org.slf4j</groupId> diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/ZipReader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/ZipReader.java new file mode 100644 index 0000000..176c9bb --- /dev/null +++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/ZipReader.java @@ -0,0 +1,76 @@ +/* + * 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.sling.jcr.contentloader.internal; + +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import javax.jcr.RepositoryException; + + +/** + * The <code>JsonReader</code> TODO + */ +class ZipReader implements ContentReader { + + static final ImportProvider ZIP_PROVIDER = new ImportProvider() { + private ZipReader zipReader; + + public ContentReader getReader() { + if (zipReader == null) { + zipReader = new ZipReader(false); + } + return zipReader; + } + }; + + static final ImportProvider JAR_PROVIDER = new ImportProvider() { + private ZipReader zipReader; + + public ContentReader getReader() { + if (zipReader == null) { + zipReader = new ZipReader(true); + } + return zipReader; + } + }; + + /** Is this a jar reader? */ + private final boolean jarReader; + + public ZipReader(boolean jarReader) { + this.jarReader = jarReader; + } + + public void parse(InputStream ins, ContentCreator creator) + throws IOException, RepositoryException { + final ZipInputStream zis = new ZipInputStream(ins); + ZipEntry entry; + do { + entry = zis.getNextEntry(); + if ( entry != null ) { + entry.getName(); + } + + } while ( entry != null ); + } + +} -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
