Package net.i2p.util
Class ZipFileComment
- java.lang.Object
-
- net.i2p.util.ZipFileComment
-
@Deprecated public abstract class ZipFileComment extends Object
Deprecated.scheduled for removal late 2017, not for external useNot available in ZipFile until Java 7. Refs: https://secure.wikimedia.org/wikipedia/en/wiki/ZIP_%28file_format%29 http://download.oracle.com/javase/1.5.0/docs/api/java/util/zip/ZipFile.html http://bugs.sun.com/view_bug.do?bug_id=6646605 Code modified from: http://www.flattermann.net/2009/01/read-a-zip-file-comment-with-java/ Beerware.- Since:
- 0.8.8
-
-
Constructor Summary
Constructors Constructor Description ZipFileComment()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
getComment(File file, int max)
Deprecated.static String
getComment(File file, int max, int skip)
Deprecated.static void
main(String[] args)
Deprecated.
-
-
-
Method Detail
-
getComment
public static String getComment(File file, int max) throws IOException
Deprecated.- Parameters:
max
- The max length of the comment in bytes. If the actual comment is longer, it will not be found and this method will throw an IOE- Returns:
- empty string if no comment, or the comment. The string is decoded with UTF-8
- Throws:
IOException
- if no valid end-of-central-directory record found
-
getComment
public static String getComment(File file, int max, int skip) throws IOException
Deprecated.- Parameters:
max
- The max length of the comment in bytes. If the actual comment is longer, it will not be found and this method will throw an IOEskip
- Number of bytes to skip in the file before looking for the zip header. Use 56 for sud/su2 files.- Returns:
- empty string if no comment, or the comment. The string is decoded with UTF-8
- Throws:
IOException
- if no valid end-of-central-directory record found
-
main
public static void main(String[] args) throws IOException
Deprecated.- Throws:
IOException
-
-