Code example for ZipEntry

Methods: getSize

0
        droidZipFileName = getClass().getResource("/saved.zip").getFile();
        ZipFile zip = new ZipFile(droidZipFileName);
        entry = zip.getEntry("profile.xml");
        in = zip.getInputStream(entry);
         
        metaData = new RequestMetaData(entry.getSize(), null, "profile.xml");
        //metaData = mock(RequestMetaData.class); 
        URI parentUri = new File(droidZipFileName).toURI();
        URI entryUri = new URI("zip:" + parentUri + "!/profile.xml");
         
        identifier = new RequestIdentifier(entryUri);
         
        //when(metaData.getSize()).thenReturn(entry.getSize()); 
        //when(metaData.getName()).thenReturn("profile.xml"); 
         
        zipResource = new ZipEntryIdentificationRequest(metaData, identifier, 3, 5, tmpDir);
        zipResource.open(in);
        //assertEquals(1, zipResource.getCache().getBuffers().size()); 
        assertNotNull(zipResource.getCache().getSourceFile());
    }