Consistent indenting, based on current POI style guide
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1540987 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
381cc611d7
commit
c6dde74f4f
@ -47,112 +47,109 @@ import org.apache.poi.util.POILogger;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Physical zip package.
|
* Physical zip package.
|
||||||
*
|
|
||||||
* @author Julien Chable
|
|
||||||
*/
|
*/
|
||||||
public final class ZipPackage extends Package {
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zip archive, as either a file on disk,
|
* Constructor. Creates a new ZipPackage.
|
||||||
* or a stream
|
*/
|
||||||
*/
|
public ZipPackage() {
|
||||||
private final ZipEntrySource zipArchive;
|
super(defaultPackageAccess);
|
||||||
|
this.zipArchive = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Creates a new ZipPackage.
|
* Constructor. Opens a Zip based Open XML document from
|
||||||
*/
|
* an InputStream.
|
||||||
public ZipPackage() {
|
*
|
||||||
super(defaultPackageAccess);
|
* @param in
|
||||||
this.zipArchive = null;
|
* 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
|
* Constructor. Opens a Zip based Open XML document from a File.
|
||||||
* an InputStream.
|
*
|
||||||
*
|
* @param path
|
||||||
* @param in
|
* The path of the file to open or create.
|
||||||
* Zip input stream to load.
|
* @param access
|
||||||
* @param access
|
* The package access mode.
|
||||||
* The package access mode.
|
* @throws InvalidFormatException
|
||||||
* @throws IllegalArgumentException
|
* If the content type part parsing encounters an error.
|
||||||
* If the specified input stream not an instance of
|
*/
|
||||||
* ZipInputStream.
|
ZipPackage(String path, PackageAccess access) {
|
||||||
*/
|
super(access);
|
||||||
ZipPackage(InputStream in, PackageAccess access) throws IOException {
|
|
||||||
super(access);
|
|
||||||
this.zipArchive = new ZipInputStreamZipEntrySource(
|
|
||||||
new ZipInputStream(in)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
ZipFile zipFile = null;
|
||||||
* 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);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
this.zipArchive = new ZipFileZipEntrySource(zipFile);
|
||||||
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;
|
||||||
* 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);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
this.zipArchive = new ZipFileZipEntrySource(zipFile);
|
||||||
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
|
||||||
* Constructor. Opens a Zip based Open XML document from
|
*
|
||||||
* a custom ZipEntrySource, typically an open archive
|
* @param zipEntry
|
||||||
* from another system
|
* Zip data to load.
|
||||||
*
|
* @param access
|
||||||
* @param zipEntry
|
* The package access mode.
|
||||||
* Zip data to load.
|
* @throws InvalidFormatException
|
||||||
* @param access
|
* If the content type part parsing encounters an error.
|
||||||
* The package access mode.
|
*/
|
||||||
* @throws InvalidFormatException
|
ZipPackage(ZipEntrySource zipEntry, PackageAccess access) {
|
||||||
* If the content type part parsing encounters an error.
|
super(access);
|
||||||
*/
|
this.zipArchive = zipEntry;
|
||||||
ZipPackage(ZipEntrySource zipEntry, PackageAccess access) {
|
}
|
||||||
super(access);
|
|
||||||
this.zipArchive = zipEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the parts from this package. We assume that the package has not
|
* Retrieves the parts from this package. We assume that the package has not
|
||||||
|
Loading…
Reference in New Issue
Block a user