You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2013/11/12 10:53:57 UTC

svn commit: r1540987 - /poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java

Author: nick
Date: Tue Nov 12 09:53:57 2013
New Revision: 1540987

URL: http://svn.apache.org/r1540987
Log:
Consistent indenting, based on current POI style guide

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java?rev=1540987&r1=1540986&r2=1540987&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java Tue Nov 12 09:53:57 2013
@@ -47,112 +47,109 @@ import org.apache.poi.util.POILogger;
 
 /**
  * Physical zip package.
- *
- * @author Julien Chable
  */
 public final class ZipPackage extends Package {
+    private static POILogger logger = POILogFactory.getLogger(ZipPackage.class);
 
-	private static POILogger logger = POILogFactory.getLogger(ZipPackage.class);
-
-	/**
-	 * Zip archive, as either a file on disk,
-	 *  or a stream
-	 */
-	private final ZipEntrySource zipArchive;
-
-	/**
-	 * Constructor. Creates a new ZipPackage.
-	 */
-	public ZipPackage() {
-		super(defaultPackageAccess);
-		this.zipArchive = null;
-	}
-
-	/**
-	 * Constructor. Opens a Zip based Open XML document from
-	 *  an InputStream.
-	 *
-	 * @param in
-	 *            Zip input stream to load.
-	 * @param access
-    *            The package access mode.
-	 * @throws IllegalArgumentException
-	 *             If the specified input stream not an instance of
-	 *             ZipInputStream.
-	 */
-	ZipPackage(InputStream in, PackageAccess access) throws IOException {
-		super(access);
-		this.zipArchive = new ZipInputStreamZipEntrySource(
-				new ZipInputStream(in)
-		);
-	}
-
-   /**
-    * Constructor. Opens a Zip based Open XML document from a File.
-    *
-    * @param path
-    *            The path of the file to open or create.
-    * @param access
-    *            The package access mode.
-    * @throws InvalidFormatException
-    *             If the content type part parsing encounters an error.
-    */
-   ZipPackage(String path, PackageAccess access) {
-      super(access);
-
-      ZipFile zipFile = null;
-
-      try {
-         zipFile = ZipHelper.openZipFile(path);
-      } catch (IOException e) {
-         throw new InvalidOperationException(
-               "Can't open the specified file: '" + path + "'", e);
-      }
-
-      this.zipArchive = new ZipFileZipEntrySource(zipFile);
-   }
-
-   /**
-    * Constructor. Opens a Zip based Open XML document.
-    *
-    * @param file
-    *            The file to open or create.
-    * @param access
-    *            The package access mode.
-    * @throws InvalidFormatException
-    *             If the content type part parsing encounters an error.
-    */
-   ZipPackage(File file, PackageAccess access) {
-      super(access);
-
-      ZipFile zipFile = null;
-
-      try {
-         zipFile = ZipHelper.openZipFile(file);
-      } catch (IOException e) {
-         throw new InvalidOperationException(
-               "Can't open the specified file: '" + file + "'", e);
-      }
-
-      this.zipArchive = new ZipFileZipEntrySource(zipFile);
-   }
-
-   /**
-    * Constructor. Opens a Zip based Open XML document from
-    *  a custom ZipEntrySource, typically an open archive
-    *  from another system
-    *
-    * @param zipEntry
-    *            Zip data to load.
-    * @param access
-    *            The package access mode.
-    * @throws InvalidFormatException
-    *             If the content type part parsing encounters an error.
-    */
-   ZipPackage(ZipEntrySource zipEntry, PackageAccess access) {
-	   super(access);
-	   this.zipArchive = zipEntry;
-   }
+    /**
+     * Zip archive, as either a file on disk,
+     *  or a stream
+     */
+    private final ZipEntrySource zipArchive;
+
+    /**
+     * Constructor. Creates a new ZipPackage.
+     */
+    public ZipPackage() {
+    	super(defaultPackageAccess);
+    	this.zipArchive = null;
+    }
+
+    /**
+     * Constructor. Opens a Zip based Open XML document from
+     *  an InputStream.
+     *
+     * @param in
+     *            Zip input stream to load.
+     * @param access
+     *            The package access mode.
+     * @throws IllegalArgumentException
+     *             If the specified input stream not an instance of
+     *             ZipInputStream.
+     */
+    ZipPackage(InputStream in, PackageAccess access) throws IOException {
+    	super(access);
+    	this.zipArchive = new ZipInputStreamZipEntrySource(
+    			new ZipInputStream(in)
+    			);
+    }
+
+    /**
+     * Constructor. Opens a Zip based Open XML document from a File.
+     *
+     * @param path
+     *            The path of the file to open or create.
+     * @param access
+     *            The package access mode.
+     * @throws InvalidFormatException
+     *             If the content type part parsing encounters an error.
+     */
+    ZipPackage(String path, PackageAccess access) {
+    	super(access);
+
+    	ZipFile zipFile = null;
+
+    	try {
+    		zipFile = ZipHelper.openZipFile(path);
+    	} catch (IOException e) {
+    		throw new InvalidOperationException(
+    				"Can't open the specified file: '" + path + "'", e);
+    	}
+
+    	this.zipArchive = new ZipFileZipEntrySource(zipFile);
+    }
+
+    /**
+     * Constructor. Opens a Zip based Open XML document.
+     *
+     * @param file
+     *            The file to open or create.
+     * @param access
+     *            The package access mode.
+     * @throws InvalidFormatException
+     *             If the content type part parsing encounters an error.
+     */
+    ZipPackage(File file, PackageAccess access) {
+    	super(access);
+
+    	ZipFile zipFile = null;
+
+    	try {
+    		zipFile = ZipHelper.openZipFile(file);
+    	} catch (IOException e) {
+    		throw new InvalidOperationException(
+    				"Can't open the specified file: '" + file + "'", e);
+    	}
+
+    	this.zipArchive = new ZipFileZipEntrySource(zipFile);
+    }
+
+    /**
+     * Constructor. Opens a Zip based Open XML document from
+     *  a custom ZipEntrySource, typically an open archive
+     *  from another system
+     *
+     * @param zipEntry
+     *            Zip data to load.
+     * @param access
+     *            The package access mode.
+     * @throws InvalidFormatException
+     *             If the content type part parsing encounters an error.
+     */
+	ZipPackage(ZipEntrySource zipEntry, PackageAccess access) {
+    	super(access);
+    	this.zipArchive = zipEntry;
+    }
 
 	/**
 	 * Retrieves the parts from this package. We assume that the package has not



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org