Code example for ZipEntry

Methods: setComment

0
    } 
 
    public void test_getComment_unset() throws Exception {
        File file = createTemporaryZipFile();
        ZipOutputStream out = createZipOutputStream(file);
        ZipEntry ze = new ZipEntry("test entry");
        ze.setComment("per-entry comment");
        out.putNextEntry(ze);
        out.close();
 
        ZipFile zipFile = new ZipFile(file);
        assertEquals(null, zipFile.getComment());
    } 
 
    // https://code.google.com/p/android/issues/detail?id=58465 
    public void test_NUL_in_filename() throws Exception {
        File file = createTemporaryZipFile();
 
        // We allow creation of a ZipEntry whose name contains a NUL byte, 
        // mainly because it's not likely to happen by accident and it's useful for testing. 
Connect your IDE to all the code out there  Get Codota for Java