Open zip files in java

Содержание
  1. Open zip files in java
  2. Field Summary
  3. Constructor Summary
  4. Method Summary
  5. Methods declared in class java.lang.Object
  6. Field Detail
  7. OPEN_READ
  8. OPEN_DELETE
  9. LOCSIG
  10. EXTSIG
  11. CENSIG
  12. ENDSIG
  13. LOCHDR
  14. EXTHDR
  15. CENHDR
  16. ENDHDR
  17. LOCVER
  18. LOCFLG
  19. LOCHOW
  20. LOCTIM
  21. LOCCRC
  22. LOCSIZ
  23. LOCLEN
  24. LOCNAM
  25. LOCEXT
  26. EXTCRC
  27. EXTSIZ
  28. EXTLEN
  29. CENVEM
  30. CENVER
  31. CENFLG
  32. CENHOW
  33. CENTIM
  34. CENCRC
  35. CENSIZ
  36. CENLEN
  37. CENNAM
  38. CENEXT
  39. CENCOM
  40. CENDSK
  41. CENATT
  42. CENATX
  43. CENOFF
  44. ENDSUB
  45. ENDTOT
  46. ENDSIZ
  47. ENDOFF
  48. ENDCOM
  49. Constructor Detail
  50. ZipFile
  51. ZipFile
  52. ZipFile
  53. ZipFile
  54. ZipFile
  55. ZipFile
  56. Method Detail
  57. getComment
  58. getEntry
  59. getInputStream
  60. getName
  61. entries
  62. stream
  63. size
  64. close
  65. finalize
  66. Class ZipInputStream
  67. Field Summary
  68. Fields declared in class java.util.zip.InflaterInputStream
  69. Fields declared in class java.io.FilterInputStream
  70. Constructor Summary
  71. Method Summary
  72. Methods declared in class java.util.zip.InflaterInputStream
  73. Methods declared in class java.io.FilterInputStream
  74. Methods declared in class java.io.InputStream
  75. Methods declared in class java.lang.Object
  76. Field Details
  77. LOCSIG
  78. EXTSIG
  79. CENSIG
  80. ENDSIG
  81. LOCHDR
  82. EXTHDR
  83. CENHDR
  84. ENDHDR
  85. LOCVER
  86. LOCFLG
  87. LOCHOW
  88. LOCTIM
  89. LOCCRC
  90. LOCSIZ
  91. LOCLEN
  92. LOCNAM
  93. LOCEXT
  94. EXTCRC
  95. EXTSIZ
  96. EXTLEN
  97. CENVEM
  98. CENVER
  99. CENFLG
  100. CENHOW
  101. CENTIM
  102. CENCRC
  103. CENSIZ
  104. CENLEN
  105. CENNAM
  106. CENEXT
  107. CENCOM
  108. CENDSK
  109. CENATT
  110. CENATX
  111. CENOFF
  112. ENDSUB
  113. ENDTOT
  114. ENDSIZ
  115. ENDOFF
  116. ENDCOM
  117. Constructor Details
  118. ZipInputStream
  119. ZipInputStream
  120. Method Details
  121. getNextEntry
  122. closeEntry
  123. available
  124. read
  125. skip
  126. close
  127. createZipEntry
  128. Open zip files in java
  129. Field Summary
  130. Constructor Summary
  131. Method Summary
  132. Methods inherited from class java.lang.Object
  133. Field Detail
  134. OPEN_READ
  135. OPEN_DELETE
  136. LOCSIG
  137. EXTSIG
  138. CENSIG
  139. ENDSIG
  140. LOCHDR
  141. EXTHDR
  142. CENHDR
  143. ENDHDR
  144. LOCVER
  145. LOCFLG
  146. LOCHOW
  147. LOCTIM
  148. LOCCRC
  149. LOCSIZ
  150. LOCLEN
  151. LOCNAM
  152. LOCEXT
  153. EXTCRC
  154. EXTSIZ
  155. EXTLEN
  156. CENVEM
  157. CENVER
  158. CENFLG
  159. CENHOW
  160. CENTIM
  161. CENCRC
  162. CENSIZ
  163. CENLEN
  164. CENNAM
  165. CENEXT
  166. CENCOM
  167. CENDSK
  168. CENATT
  169. CENATX
  170. CENOFF
  171. ENDSUB
  172. ENDTOT
  173. ENDSIZ
  174. ENDOFF
  175. ENDCOM
  176. Constructor Detail
  177. ZipFile
  178. ZipFile
  179. ZipFile
  180. ZipFile
  181. ZipFile
  182. ZipFile
  183. Method Detail
  184. getComment

Open zip files in java

This class is used to read entries from a zip file. Unless otherwise noted, passing a null argument to a constructor or method in this class will cause a NullPointerException to be thrown.

Читайте также:  What can you do with php language

Field Summary

Constructor Summary

Method Summary

Methods declared in class java.lang.Object

Field Detail

OPEN_READ

public static final int OPEN_READ

OPEN_DELETE

public static final int OPEN_DELETE

Mode flag to open a zip file and mark it for deletion. The file will be deleted some time between the moment that it is opened and the moment that it is closed, but its contents will remain accessible via the ZipFile object until either the close method is invoked or the virtual machine exits.

LOCSIG

public static final long LOCSIG

EXTSIG

public static final long EXTSIG

CENSIG

public static final long CENSIG

ENDSIG

public static final long ENDSIG

LOCHDR

public static final int LOCHDR

EXTHDR

public static final int EXTHDR

CENHDR

public static final int CENHDR

ENDHDR

public static final int ENDHDR

LOCVER

public static final int LOCVER

LOCFLG

public static final int LOCFLG

LOCHOW

public static final int LOCHOW

LOCTIM

public static final int LOCTIM

LOCCRC

public static final int LOCCRC

LOCSIZ

public static final int LOCSIZ

LOCLEN

public static final int LOCLEN

LOCNAM

public static final int LOCNAM

LOCEXT

public static final int LOCEXT

EXTCRC

public static final int EXTCRC

EXTSIZ

public static final int EXTSIZ

EXTLEN

public static final int EXTLEN

CENVEM

public static final int CENVEM

CENVER

public static final int CENVER

CENFLG

public static final int CENFLG

CENHOW

public static final int CENHOW

CENTIM

public static final int CENTIM

CENCRC

public static final int CENCRC

CENSIZ

public static final int CENSIZ

CENLEN

public static final int CENLEN

CENNAM

public static final int CENNAM

CENEXT

public static final int CENEXT

CENCOM

public static final int CENCOM

CENDSK

public static final int CENDSK

CENATT

public static final int CENATT

CENATX

public static final int CENATX

CENOFF

public static final int CENOFF

ENDSUB

public static final int ENDSUB

ENDTOT

public static final int ENDTOT

ENDSIZ

public static final int ENDSIZ

ENDOFF

public static final int ENDOFF

ENDCOM

public static final int ENDCOM

Constructor Detail

ZipFile

Opens a zip file for reading. First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed. The UTF-8 charset is used to decode the entry names and comments.

Читайте также:  Html select option onchange

ZipFile

public ZipFile​(File file, int mode) throws IOException

Opens a new ZipFile to read from the specified File object in the specified mode. The mode argument must be either OPEN_READ or OPEN_READ | OPEN_DELETE . First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed. The UTF-8 charset is used to decode the entry names and comments

ZipFile

public ZipFile​(File file) throws ZipException, IOException

Opens a ZIP file for reading given the specified File object. The UTF-8 charset is used to decode the entry names and comments.

ZipFile

public ZipFile​(File file, int mode, Charset charset) throws IOException

Opens a new ZipFile to read from the specified File object in the specified mode. The mode argument must be either OPEN_READ or OPEN_READ | OPEN_DELETE . First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed.

ZipFile

public ZipFile​(String name, Charset charset) throws IOException

Opens a zip file for reading. First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed.

ZipFile

public ZipFile​(File file, Charset charset) throws IOException

Method Detail

getComment

getEntry

getInputStream

public InputStream getInputStream​(ZipEntry entry) throws IOException

Returns an input stream for reading the contents of the specified zip file entry. Closing this ZIP file will, in turn, close all input streams that have been returned by invocations of this method.

getName

entries

stream

Returns an ordered Stream over the ZIP file entries. Entries appear in the Stream in the order they appear in the central directory of the ZIP file.

size

close

Closes the ZIP file. Closing this ZIP file will close all of the input streams previously returned by invocations of the getInputStream method.

finalize

@Deprecated(since="9", forRemoval=true) protected void finalize() throws IOException

The finalize method has been deprecated and will be removed. It is implemented as a no-op. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. The recommended cleanup for ZipFile object is to explicitly invoke close method when it is no longer in use, or use try-with-resources. If the close is not invoked explicitly the resources held by this object will be released when the instance becomes unreachable.

Ensures that the system resources held by this ZipFile object are released when there are no more references to it.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Class ZipInputStream

This class implements an input stream filter for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries.

Field Summary

Fields declared in class java.util.zip.InflaterInputStream

Fields declared in class java.io.FilterInputStream

Constructor Summary

Method Summary

Methods declared in class java.util.zip.InflaterInputStream

Methods declared in class java.io.FilterInputStream

Methods declared in class java.io.InputStream

Methods declared in class java.lang.Object

Field Details

LOCSIG

EXTSIG

CENSIG

ENDSIG

LOCHDR

EXTHDR

CENHDR

ENDHDR

LOCVER

LOCFLG

LOCHOW

LOCTIM

LOCCRC

LOCSIZ

LOCLEN

LOCNAM

LOCEXT

EXTCRC

EXTSIZ

EXTLEN

CENVEM

CENVER

CENFLG

CENHOW

CENTIM

CENCRC

CENSIZ

CENLEN

CENNAM

CENEXT

CENCOM

CENDSK

CENATT

CENATX

CENOFF

ENDSUB

ENDTOT

ENDSIZ

ENDOFF

ENDCOM

Constructor Details

ZipInputStream

ZipInputStream

Method Details

getNextEntry

closeEntry

available

Returns 0 after EOF has reached for the current entry data, otherwise always return 1. Programs should not count on this method to return the actual number of bytes that could be read without blocking.

read

Reads from the current ZIP entry into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned.

skip

close

createZipEntry

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Open zip files in java

This class is used to read entries from a zip file. Unless otherwise noted, passing a null argument to a constructor or method in this class will cause a NullPointerException to be thrown.

Field Summary

Fields
Modifier and Type Field and Description
static int CENATT
static int CENATX
static int CENCOM
static int CENCRC
static int CENDSK
static int CENEXT
static int CENFLG
static int CENHDR
static int CENHOW
static int CENLEN
static int CENNAM
static int CENOFF
static long CENSIG
static int CENSIZ
static int CENTIM
static int CENVEM
static int CENVER
static int ENDCOM
static int ENDHDR
static int ENDOFF
static long ENDSIG
static int ENDSIZ
static int ENDSUB
static int ENDTOT
static int EXTCRC
static int EXTHDR
static int EXTLEN
static long EXTSIG
static int EXTSIZ
static int LOCCRC
static int LOCEXT
static int LOCFLG
static int LOCHDR
static int LOCHOW
static int LOCLEN
static int LOCNAM
static long LOCSIG
static int LOCSIZ
static int LOCTIM
static int LOCVER
static int OPEN_DELETE

Constructor Summary

Method Summary

Ensures that the system resources held by this ZipFile object are released when there are no more references to it.

Methods inherited from class java.lang.Object

Field Detail

OPEN_READ

public static final int OPEN_READ

OPEN_DELETE

public static final int OPEN_DELETE

Mode flag to open a zip file and mark it for deletion. The file will be deleted some time between the moment that it is opened and the moment that it is closed, but its contents will remain accessible via the ZipFile object until either the close method is invoked or the virtual machine exits.

LOCSIG

public static final long LOCSIG

EXTSIG

public static final long EXTSIG

CENSIG

public static final long CENSIG

ENDSIG

public static final long ENDSIG

LOCHDR

public static final int LOCHDR

EXTHDR

public static final int EXTHDR

CENHDR

public static final int CENHDR

ENDHDR

public static final int ENDHDR

LOCVER

public static final int LOCVER

LOCFLG

public static final int LOCFLG

LOCHOW

public static final int LOCHOW

LOCTIM

public static final int LOCTIM

LOCCRC

public static final int LOCCRC

LOCSIZ

public static final int LOCSIZ

LOCLEN

public static final int LOCLEN

LOCNAM

public static final int LOCNAM

LOCEXT

public static final int LOCEXT

EXTCRC

public static final int EXTCRC

EXTSIZ

public static final int EXTSIZ

EXTLEN

public static final int EXTLEN

CENVEM

public static final int CENVEM

CENVER

public static final int CENVER

CENFLG

public static final int CENFLG

CENHOW

public static final int CENHOW

CENTIM

public static final int CENTIM

CENCRC

public static final int CENCRC

CENSIZ

public static final int CENSIZ

CENLEN

public static final int CENLEN

CENNAM

public static final int CENNAM

CENEXT

public static final int CENEXT

CENCOM

public static final int CENCOM

CENDSK

public static final int CENDSK

CENATT

public static final int CENATT

CENATX

public static final int CENATX

CENOFF

public static final int CENOFF

ENDSUB

public static final int ENDSUB

ENDTOT

public static final int ENDTOT

ENDSIZ

public static final int ENDSIZ

ENDOFF

public static final int ENDOFF

ENDCOM

public static final int ENDCOM

Constructor Detail

ZipFile

Opens a zip file for reading. First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed. The UTF-8 charset is used to decode the entry names and comments.

ZipFile

public ZipFile(File file, int mode) throws IOException

Opens a new ZipFile to read from the specified File object in the specified mode. The mode argument must be either OPEN_READ or OPEN_READ | OPEN_DELETE. First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed. The UTF-8 charset is used to decode the entry names and comments

ZipFile

public ZipFile(File file) throws ZipException, IOException

Opens a ZIP file for reading given the specified File object. The UTF-8 charset is used to decode the entry names and comments.

ZipFile

public ZipFile(File file, int mode, Charset charset) throws IOException

Opens a new ZipFile to read from the specified File object in the specified mode. The mode argument must be either OPEN_READ or OPEN_READ | OPEN_DELETE. First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed.

ZipFile

public ZipFile(String name, Charset charset) throws IOException

Opens a zip file for reading. First, if there is a security manager, its checkRead method is called with the name argument as its argument to ensure the read is allowed.

ZipFile

public ZipFile(File file, Charset charset) throws IOException

Method Detail

getComment

Источник

Оцените статью