Home
last modified time | relevance | path

Searched refs:zipFile (Results 1 – 25 of 25) sorted by relevance

/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/zip/
DAlignmentTest.java222 File zipFile = new File(mTemporaryFolder.getRoot(), "test.zip");
228 try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) {
241 try (ZFile zf = new ZFile(zipFile, options)) {
248 File zipFile = new File(mTemporaryFolder.getRoot(), "test.zip");
255 try (ZFile zf = new ZFile(zipFile, options)) {
262 assertArrayEquals(recognizable, readSegment(zipFile, 1024, recognizable.length));
267 try (ZFile zf = new ZFile(zipFile)) {
276 File zipFile = new File(mTemporaryFolder.getRoot(), "test.zip");
283 try (ZFile zf = new ZFile(zipFile, options)) {
290 assertArrayEquals(recognizable, readSegment(zipFile, 1024, recognizable.length));
[all …]
DZFileTest.java216 File zipFile = mTemporaryFolder.newFile("test.zip");
218 try(ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) {
230 try (ZFile zf = new ZFile(zipFile)) {
240 try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile))) {
254 File zipFile = mTemporaryFolder.newFile("test.zip");
256 try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) {
266 ZFile zf = new ZFile(zipFile);
271 try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile))) {
284 File zipFile = new File(mTemporaryFolder.getRoot(), "test.zip");
286 ZFile zf = new ZFile(zipFile);
[all …]
DZFileNotificationTest.java345 File zipFile = new File(mTemporaryFolder.getRoot(), "a.zip"); in canAddFilesDuringUpdateNotification() local
346 try (ZFile zf = new ZFile(zipFile)) { in canAddFilesDuringUpdateNotification()
375 try (ZFile zf2 = new ZFile(zipFile)) { in canAddFilesDuringUpdateNotification()
385 File zipFile = new File(mTemporaryFolder.getRoot(), "a.zip"); in notifyOnceEntriesWritten() local
387 try (ZFile zf = new ZFile(zipFile)) { in notifyOnceEntriesWritten()
401 File zipFile = new File(mTemporaryFolder.getRoot(), "a.zip"); in notifyTwiceEntriesWrittenIfCdChanged() local
403 try (ZFile zf = new ZFile(zipFile)) { in notifyTwiceEntriesWrittenIfCdChanged()
/tools/tradefederation/core/common_util/com/android/tradefed/util/
DZipUtil.java72 public static boolean isZipFileValid(File zipFile, boolean thorough) throws IOException { in isZipFileValid() argument
73 if (zipFile != null && !zipFile.exists()) { in isZipFileValid()
74 CLog.d("Zip file does not exist: %s", zipFile.getAbsolutePath()); in isZipFileValid()
78 try (ZipFile z = new ZipFile(zipFile)) { in isZipFileValid()
81 final File extractDir = FileUtil.createTempDir("extract-" + zipFile.getName()); in isZipFileValid()
90 CLog.d("Detected corrupt zip file %s:", zipFile.getCanonicalPath()); in isZipFileValid()
105 public static void extractZip(ZipFile zipFile, File destDir) throws IOException { in extractZip() argument
106 Enumeration<? extends ZipEntry> entries = zipFile.entries(); in extractZip()
115 FileUtil.writeToFile(zipFile.getInputStream(entry), childFile); in extractZip()
128 public static File extractFileFromZip(ZipFile zipFile, String filePath) throws IOException { in extractFileFromZip() argument
[all …]
DZipUtil2.java61 public static void extractZip(ZipFile zipFile, File destDir) throws IOException { in extractZip() argument
62 Enumeration<? extends ZipArchiveEntry> entries = zipFile.getEntries(); in extractZip()
75 FileUtil.writeToFile(zipFile.getInputStream(entry), childFile); in extractZip()
97 public static void extractZip(File zipFile, File destDir) throws IOException { in extractZip() argument
98 try (ZipFile zip = new ZipFile(zipFile)) { in extractZip()
111 public static File extractFileFromZip(ZipFile zipFile, String filePath) throws IOException { in extractFileFromZip() argument
112 ZipArchiveEntry entry = zipFile.getEntry(filePath); in extractFileFromZip()
118 FileUtil.writeToFile(zipFile.getInputStream(entry), createdFile); in extractFileFromZip()
130 public static File extractZipToTemp(File zipFile, String nameHint) throws IOException { in extractZipToTemp() argument
132 try (ZipFile zip = new ZipFile(zipFile)) { in extractZipToTemp()
[all …]
DFileUtil.java990 public static void extractZip(ZipFile zipFile, File destDir) throws IOException { in extractZip() argument
991 ZipUtil.extractZip(zipFile, destDir); in extractZip()
1004 public static File extractFileFromZip(ZipFile zipFile, String filePath) throws IOException { in extractFileFromZip() argument
1005 return ZipUtil.extractFileFromZip(zipFile, filePath); in extractFileFromZip()
1032 public static void createZip(File dir, File zipFile) throws IOException { in createZip() argument
1033 ZipUtil.createZip(dir, zipFile); in createZip()
1043 public static void closeZip(ZipFile zipFile) { in closeZip() argument
1044 ZipUtil.closeZip(zipFile); in closeZip()
/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/sign/
DJarSigningTest.java48 File zipFile = new File(mTemporaryFolder.getRoot(), "a.zip"); in signEmptyJar() local
50 try (ZFile zf = new ZFile(zipFile)) { in signEmptyJar()
62 try (ZFile verifyZFile = new ZFile(zipFile)) { in signEmptyJar()
76 File zipFile = new File(mTemporaryFolder.getRoot(), "a.zip"); in signJarWithPrexistingSimpleTextFilePre18() local
79 try (ZFile zf1 = new ZFile(zipFile)) { in signJarWithPrexistingSimpleTextFilePre18()
85 try (ZFile zf2 = new ZFile(zipFile)) { in signJarWithPrexistingSimpleTextFilePre18()
91 try (ZFile zf3 = new ZFile(zipFile)) { in signJarWithPrexistingSimpleTextFilePre18()
133 File zipFile = new File(mTemporaryFolder.getRoot(), "a.zip"); in signJarWithPrexistingSimpleTextFilePos18() local
134 try (ZFile zf1 = new ZFile(zipFile)) { in signJarWithPrexistingSimpleTextFilePos18()
142 try (ZFile zf2 = new ZFile(zipFile)) { in signJarWithPrexistingSimpleTextFilePos18()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/
DTestMappingSuiteRunnerTest.java257 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZip() local
258 ZipUtil.createZip(filesToZip, zipFile); in testLoadTests_testMappingsZip()
265 EasyMock.expect(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).andReturn(zipFile); in testLoadTests_testMappingsZip()
327 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZipFoundTestsWithKeywords() local
328 ZipUtil.createZip(filesToZip, zipFile); in testLoadTests_testMappingsZipFoundTestsWithKeywords()
335 EasyMock.expect(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).andReturn(zipFile); in testLoadTests_testMappingsZipFoundTestsWithKeywords()
399 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZipFailWithKeywords() local
400 ZipUtil.createZip(filesToZip, zipFile); in testLoadTests_testMappingsZipFailWithKeywords()
406 EasyMock.expect(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).andReturn(zipFile); in testLoadTests_testMappingsZipFailWithKeywords()
447 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZipHostTests() local
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/util/
DZipUtilTest.java62 final File zipFile = createTempFile(name, ".zip"); in getTestDataFile() local
63 FileUtil.writeToFile(inputStream, zipFile); in getTestDataFile()
64 return zipFile; in getTestDataFile()
99 File zipFile = null; in testCreateAndExtractZip() local
106 zipFile = ZipUtil.createZip(tmpParentDir); in testCreateAndExtractZip()
107 ZipUtil.extractZip(new ZipFile(zipFile), extractedDir); in testCreateAndExtractZip()
118 FileUtil.deleteFile(zipFile); in testCreateAndExtractZip()
129 File zipFile = null; in testCreateAndExtractZip_fromFiles() local
136 zipFile = ZipUtil.createZip(Arrays.asList(file1, file2)); in testCreateAndExtractZip_fromFiles()
137 ZipUtil.extractZip(new ZipFile(zipFile), extractedDir); in testCreateAndExtractZip_fromFiles()
[all …]
DZipUtil2Test.java76 ZipFile zipFile = null; in testExtractFileFromZip() local
78 zipFile = new ZipFile(zip); in testExtractFileFromZip()
79 File extracted = ZipUtil2.extractFileFromZip(zipFile, fileName); in testExtractFileFromZip()
83 ZipFile.closeQuietly(zipFile); in testExtractFileFromZip()
91 ZipFile zipFile = null; in testExtractZip() local
93 zipFile = new ZipFile(zip); in testExtractZip()
94 ZipUtil2.extractZip(zipFile, destDir); in testExtractZip()
101 ZipFile.closeQuietly(zipFile); in testExtractZip()
125 final File zipFile = createTempFile(name, ".zip"); in getTestDataFile() local
126 FileUtil.writeToFile(inputStream, zipFile); in getTestDataFile()
[all …]
DRemoteZipTest.java81 File zipFile = FileUtil.createTempFileForRemote("zipfile", null); in setUp() local
83 zipFile.delete(); in setUp()
85 saveTestDataFile(zipFile, -1, 0); in setUp()
86 EndCentralDirectoryInfo endCentralDirInfo = new EndCentralDirectoryInfo(zipFile); in setUp()
89 zipFile, endCentralDirInfo, endCentralDirInfo.getCentralDirOffset()); in setUp()
90 mZipFileSize = zipFile.length(); in setUp()
92 FileUtil.deleteFile(zipFile); in setUp()
DZipUtilFuncTest.java92 ZipFile zipFile = new ZipFile(sLargeFile.getAbsolutePath()); in testCentralDirectoryInfos() local
99 Assert.assertEquals(zipFile.size(), endCentralDirInfo.getEntryNumber()); in testCentralDirectoryInfos()
103 validateCentralDirectoryInfos(zipFile, zipEntries); in testCentralDirectoryInfos()
172 ZipFile zipFile, List<CentralDirectoryInfo> zipEntries) { in validateCentralDirectoryInfos() argument
175 Enumeration<? extends ZipEntry> entries = zipFile.entries(); in validateCentralDirectoryInfos()
DBugreportTest.java159 File zipFile = null; in testBugreportz_noMainFile() local
166 zipFile = ZipUtil.createZip(new File("")); in testBugreportz_noMainFile()
167 FileOutputStream fileStream = new FileOutputStream(zipFile); in testBugreportz_noMainFile()
172 mBugreport = new Bugreport(zipFile, true); in testBugreportz_noMainFile()
176 FileUtil.deleteFile(zipFile); in testBugreportz_noMainFile()
/tools/tradefederation/core/common_util/com/android/tradefed/util/zip/
DEndCentralDirectoryInfo.java70 public EndCentralDirectoryInfo(File zipFile) throws IOException { in EndCentralDirectoryInfo() argument
71 this(zipFile, false); in EndCentralDirectoryInfo()
82 public EndCentralDirectoryInfo(File zipFile, boolean useZip64) throws IOException { in EndCentralDirectoryInfo() argument
110 byte[] data = getEndCentralDirectoryInfo(zipFile, END_CENTRAL_DIRECTORY_SIGNATURE); in EndCentralDirectoryInfo()
134 data = getEndCentralDirectoryInfo(zipFile, ZIP64_END_CENTRAL_DIRECTORY_SIGNATURE); in EndCentralDirectoryInfo()
150 private byte[] getEndCentralDirectoryInfo(File zipFile, byte[] signature) throws IOException { in getEndCentralDirectoryInfo() argument
151 try (FileInputStream stream = new FileInputStream(zipFile)) { in getEndCentralDirectoryInfo()
173 + zipFile.getPath()); in getEndCentralDirectoryInfo()
/tools/tradefederation/core/test_framework/com/android/tradefed/targetprep/multi/
DMixImageZipPreparer.java339 final ZipFile zipFile, Predicate<String> predicate) throws IOException { in getInputStreamFactoriesFromImageZip() argument
341 Enumeration<? extends ZipEntry> entries = zipFile.entries(); in getInputStreamFactoriesFromImageZip()
366 return zipFile.getInputStream(entry); in getInputStreamFactoriesFromImageZip()
454 File zipFile = null; in createZip() local
457 zipFile = FileUtil.createTempFile("MixedImg", ".zip"); in createZip()
458 out = new FileOutputStream(zipFile); in createZip()
484 File returnValue = zipFile; in createZip()
485 zipFile = null; in createZip()
489 FileUtil.deleteFile(zipFile); in createZip()
/tools/tradefederation/core/tests/src/com/android/tradefed/util/testmapping/
DTestMappingTest.java162 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testGetTests() local
163 ZipUtil.createZip(filesToZip, zipFile); in testGetTests()
165 EasyMock.expect(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).andReturn(zipFile).times(2); in testGetTests()
216 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testGetTests_matchKeywords() local
217 ZipUtil.createZip(filesToZip, zipFile); in testGetTests_matchKeywords()
219 EasyMock.expect(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).andReturn(zipFile).times(2); in testGetTests_matchKeywords()
546 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testExtractTestMappingsZip() local
547 ZipUtil.createZip(filesToZip, zipFile); in testExtractTestMappingsZip()
549 extractedFile = TestMapping.extractTestMappingsZip(zipFile); in testExtractTestMappingsZip()
/tools/tradefederation/core/tests/src/com/android/tradefed/result/
DLogFileSaverTest.java203 ZipFile zipFile = null; in testSaveAndZipLogData() local
213 zipFile = new ZipFile(logFile); in testSaveAndZipLogData()
215 String actualLogString = StreamUtil.getStringFromStream(zipFile.getInputStream( in testSaveAndZipLogData()
219 if (zipFile != null) { in testSaveAndZipLogData()
220 zipFile.close(); in testSaveAndZipLogData()
DFileSystemLogSaverTest.java168 ZipFile zipFile = null; in testSaveLogData_uncompressed() local
182 zipFile = new ZipFile(new File(logFile.getPath())); in testSaveLogData_uncompressed()
184 String actualLogString = StreamUtil.getStringFromStream(zipFile.getInputStream( in testSaveLogData_uncompressed()
189 if (zipFile != null) { in testSaveLogData_uncompressed()
190 zipFile.close(); in testSaveLogData_uncompressed()
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/multi/
DMixImageZipPreparerTest.java439 ZipFile zipFile = null; in runCreateZipTest() local
442 zipFile = new ZipFile(file); in runCreateZipTest()
444 Assert.assertEquals(data.size(), zipFile.stream().count()); in runCreateZipTest()
447 ZipEntry actual = zipFile.getEntry(entry.getKey()); in runCreateZipTest()
461 ZipUtil.closeZip(zipFile); in runCreateZipTest()
/tools/tradefederation/core/tests/src/com/android/tradefed/config/remote/
DGcsRemoteFileResolverTest.java88 File zipFile = ZipUtil.createZip(testDir); in testResolve_unzip() local
91 Mockito.doReturn(zipFile).when(mMockHelper).fetchTestResource("gs:/fake/file"); in testResolve_unzip()
98 assertFalse(zipFile.exists()); in testResolve_unzip()
103 FileUtil.deleteFile(zipFile); in testResolve_unzip()
/tools/tradefederation/core/test_framework/com/android/tradefed/targetprep/
DDynamicSystemPreparer.java68 ZipFile zipFile = null; in setUp() local
72 zipFile = new ZipFile(systemImageZipFile); in setUp()
73 systemImage = ZipUtil2.extractFileFromZip(zipFile, "system.img"); in setUp()
124 ZipUtil2.closeZip(zipFile); in setUp()
/tools/tradefederation/core/src/com/android/tradefed/build/
DLocalDeviceBuildProvider.java170 File zipFile = null; in createBuildImageZip() local
176 zipFile = ZipUtil.createZip(buildFiles); in createBuildImageZip()
180 CLog.i("Created build image zip on: %s", zipFile.getAbsolutePath()); in createBuildImageZip()
181 return zipFile; in createBuildImageZip()
/tools/tradefederation/contrib/src/com/android/performance/tests/
DAppTransitionTests.java452 File zipFile = null; in logTraceFiles() local
465 zipFile = ZipUtil.createZip(tmpDestDir); in logTraceFiles()
466 streamSource = new FileInputStreamSource(zipFile); in logTraceFiles()
472 FileUtil.deleteFile(zipFile); in logTraceFiles()
/tools/tradefederation/core/src/com/android/tradefed/cluster/
DClusterBuildProvider.java74 try (ZipFile zipFile = new ZipFile(zip)) { in extractZip() argument
75 ZipUtil2.extractZip(zipFile, destDir); in extractZip()
/tools/tradefederation/core/src/com/android/tradefed/device/
DNativeDevice.java2547 File zipFile = null; in getBugreportzInternal() local
2554 zipFile = FileUtil.createTempFile("bugreportz", ".zip"); in getBugreportzInternal()
2555 pullFile(remoteFilePath, zipFile); in getBugreportzInternal()
2563 return zipFile; in getBugreportzInternal()