1 *java.util.zip.ZipFile* *ZipFile* This class is used to read entries from a zip
4 extends |java.lang.Object|
5 implements |java.util.zip.ZipConstants|
7 |java.util.zip.ZipFile_Description|
8 |java.util.zip.ZipFile_Fields|
9 |java.util.zip.ZipFile_Constructors|
10 |java.util.zip.ZipFile_Methods|
12 ================================================================================
14 *java.util.zip.ZipFile_Fields*
15 |int_java.util.zip.ZipFile.OPEN_DELETE|
16 |int_java.util.zip.ZipFile.OPEN_READ|
18 *java.util.zip.ZipFile_Constructors*
19 |java.util.zip.ZipFile(File)|Opens a ZIP file for reading given the specified F
20 |java.util.zip.ZipFile(File,int)|Opens a new ZipFile to read from the specified
21 |java.util.zip.ZipFile(String)|Opens a zip file for reading.
23 *java.util.zip.ZipFile_Methods*
24 |java.util.zip.ZipFile.close()|Closes the ZIP file.
25 |java.util.zip.ZipFile.entries()|Returns an enumeration of the ZIP file entries
26 |java.util.zip.ZipFile.finalize()|Ensures that the close method of this ZIP fil
27 |java.util.zip.ZipFile.getEntry(String)|Returns the zip file entry for the spec
28 |java.util.zip.ZipFile.getInputStream(ZipEntry)|Returns an input stream for rea
29 |java.util.zip.ZipFile.getName()|Returns the path name of the ZIP file.
30 |java.util.zip.ZipFile.size()|Returns the number of entries in the ZIP file.
32 *java.util.zip.ZipFile_Description*
34 This class is used to read entries from a zip file.
36 Unless otherwise noted, passing a null argument to a constructor or method in
37 this class will cause a (|java.lang.NullPointerException|) to be thrown.
40 *int_java.util.zip.ZipFile.OPEN_DELETE*
42 This class is used to read entries from a zip file.
44 Unless otherwise noted, passing a null argument to a constructor or method in
45 this class will cause a (|java.lang.NullPointerException|) to be thrown.
48 *int_java.util.zip.ZipFile.OPEN_READ*
50 This class is used to read entries from a zip file.
52 Unless otherwise noted, passing a null argument to a constructor or method in
53 this class will cause a (|java.lang.NullPointerException|) to be thrown.
57 *java.util.zip.ZipFile(File)*
59 public ZipFile(java.io.File file)
60 throws |java.io.IOException|
61 |java.util.zip.ZipException|
63 Opens a ZIP file for reading given the specified File object.
65 file - the ZIP file to be opened for reading
67 *java.util.zip.ZipFile(File,int)*
72 throws |java.io.IOException|
74 Opens a new ZipFile to read from the specified File object in the specified
75 mode. The mode argument must be either OPEN_READ or OPEN_READ | OPEN_DELETE.
77 First, if there is a security manager, its checkRead method is called with the
78 name argument as its argument to ensure the read is allowed.
80 file - the ZIP file to be opened for reading
81 mode - the mode in which the file is to be opened
83 *java.util.zip.ZipFile(String)*
85 public ZipFile(java.lang.String name)
86 throws |java.io.IOException|
88 Opens a zip file for reading.
90 First, if there is a security manager, its checkRead method is called with the
91 name argument as its argument to ensure the read is allowed.
93 name - the name of the zip file
95 *java.util.zip.ZipFile.close()*
98 throws |java.io.IOException|
100 Closes the ZIP file. Closing this ZIP file will close all of the input streams
101 previously returned by invocations of the
102 getInputStream(|java.util.zip.ZipFile|) method.
105 *java.util.zip.ZipFile.entries()*
107 public |java.util.Enumeration| entries()
109 Returns an enumeration of the ZIP file entries.
112 Returns: an enumeration of the ZIP file entries
113 *java.util.zip.ZipFile.finalize()*
115 protected void finalize()
116 throws |java.io.IOException|
118 Ensures that the close method of this ZIP file is called when there are no more
121 Since the time when GC would invoke this method is undetermined, it is strongly
122 recommended that applications invoke the close method as soon they have
123 finished accessing this ZipFile. This will prevent holding up system resources
124 for an undetermined length of time.
127 *java.util.zip.ZipFile.getEntry(String)*
129 public |java.util.zip.ZipEntry| getEntry(java.lang.String name)
131 Returns the zip file entry for the specified name, or null if not found.
133 name - the name of the entry
135 Returns: the zip file entry, or null if not found
136 *java.util.zip.ZipFile.getInputStream(ZipEntry)*
138 public |java.io.InputStream| getInputStream(java.util.zip.ZipEntry entry)
139 throws |java.io.IOException|
141 Returns an input stream for reading the contents of the specified zip file
144 Returns an input stream for reading the contents of the specified zip file
147 Closing this ZIP file will, in turn, close all input streams that have been
148 returned by invocations of this method.
150 entry - the zip file entry
152 Returns: the input stream for reading the contents of the specified zip file entry.
153 *java.util.zip.ZipFile.getName()*
155 public |java.lang.String| getName()
157 Returns the path name of the ZIP file.
160 Returns: the path name of the ZIP file
161 *java.util.zip.ZipFile.size()*
165 Returns the number of entries in the ZIP file.
168 Returns: the number of entries in the ZIP file