/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/zip/ |
D | AlignmentTest.java | 222 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 …]
|
D | ZFileTest.java | 216 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 …]
|
D | ZFileNotificationTest.java | 345 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/ |
D | ZipUtil.java | 76 public static boolean isZipFileValid(File zipFile, boolean thorough) throws IOException { in isZipFileValid() argument 77 if (zipFile == null) { in isZipFileValid() 81 if (!zipFile.exists()) { in isZipFileValid() 82 CLog.d("Zip file does not exist: %s", zipFile.getAbsolutePath()); in isZipFileValid() 86 try (ZipFile z = new ZipFile(zipFile)) { in isZipFileValid() 89 final File extractDir = FileUtil.createTempDir("extract-" + zipFile.getName()); in isZipFileValid() 98 CLog.d("Detected corrupt zip file %s:", zipFile.getCanonicalPath()); in isZipFileValid() 113 public static void extractZip(ZipFile zipFile, File destDir) throws IOException { in extractZip() argument 114 Enumeration<? extends ZipEntry> entries = zipFile.entries(); in extractZip() 123 FileUtil.writeToFile(zipFile.getInputStream(entry), childFile); in extractZip() [all …]
|
D | ZipUtil2.java | 66 private static boolean extractZipEntry(ZipFile zipFile, ZipArchiveEntry entry, File destFile) in extractZipEntry() argument 68 FileUtil.writeToFile(zipFile.getInputStream(entry), destFile); in extractZipEntry() 79 public static void extractZip(ZipFile zipFile, File destDir) throws IOException { in extractZip() argument 80 Enumeration<? extends ZipArchiveEntry> entries = zipFile.getEntries(); in extractZip() 94 if (!extractZipEntry(zipFile, entry, childFile)) { in extractZip() 117 try (java.util.zip.ZipFile zipFile = new java.util.zip.ZipFile(toUnzip)) { in extractZip() argument 118 ZipUtil.extractZip(zipFile, destDir); in extractZip() 140 public static boolean extractFileFromZip(ZipFile zipFile, String filePath, File destFile) in extractFileFromZip() argument 142 ZipArchiveEntry entry = zipFile.getEntry(filePath); in extractFileFromZip() 146 extractZipEntry(zipFile, entry, destFile); in extractFileFromZip() [all …]
|
D | FuseUtil.java | 69 public void mountZip(File zipFile, File mountDir) { in mountZip() argument 76 zipFile.getAbsolutePath(), in mountZip() 80 String.format("Failed to mount %s: %s", zipFile, res.getStderr()), in mountZip()
|
D | FileUtil.java | 1109 public static void extractZip(ZipFile zipFile, File destDir) throws IOException { in extractZip() argument 1110 ZipUtil.extractZip(zipFile, destDir); in extractZip() 1123 public static File extractFileFromZip(ZipFile zipFile, String filePath) throws IOException { in extractFileFromZip() argument 1124 return ZipUtil.extractFileFromZip(zipFile, filePath); in extractFileFromZip() 1151 public static void createZip(File dir, File zipFile) throws IOException { in createZip() argument 1152 ZipUtil.createZip(dir, zipFile); in createZip() 1162 public static void closeZip(ZipFile zipFile) { in closeZip() argument 1163 ZipUtil.closeZip(zipFile); in closeZip()
|
/tools/tradefederation/core/javatests/com/android/tradefed/util/ |
D | ZipUtil2Test.java | 80 ZipFile zipFile = null; in testExtractFileFromZip() local 82 zipFile = new ZipFile(zip); in testExtractFileFromZip() 83 boolean extracted = ZipUtil2.extractFileFromZip(zipFile, "NOT_EXIST", destFile); in testExtractFileFromZip() 85 extracted = ZipUtil2.extractFileFromZip(zipFile, fileName, destFile); in testExtractFileFromZip() 89 ZipFile.closeQuietly(zipFile); in testExtractFileFromZip() 97 ZipFile zipFile = null; in testExtractFileFromZipToTemp() local 99 zipFile = new ZipFile(zip); in testExtractFileFromZipToTemp() 100 File extracted = ZipUtil2.extractFileFromZip(zipFile, fileName); in testExtractFileFromZipToTemp() 104 ZipFile.closeQuietly(zipFile); in testExtractFileFromZipToTemp() 119 ZipFile zipFile = null; in testExtractZipWithEmptyDir() local [all …]
|
D | RemoteZipTest.java | 81 File zipFile = FileUtil.createTempFileForRemote("zipfile", null); in setUp() local 83 zipFile.delete(); in setUp() 85 saveTestDataFile(zipFile, 0, -1); 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()
|
D | ZipUtilTest.java | 71 final File zipFile = createTempFile(name, ".zip"); in getTestDataFile() local 72 FileUtil.writeToFile(inputStream, zipFile); in getTestDataFile() 73 return zipFile; in getTestDataFile() 114 File zipFile = null; in testCreateAndExtractZip() local 121 zipFile = ZipUtil.createZip(tmpParentDir); in testCreateAndExtractZip() 122 ZipUtil.extractZip(new ZipFile(zipFile), extractedDir); in testCreateAndExtractZip() 133 FileUtil.deleteFile(zipFile); in testCreateAndExtractZip() 145 File zipFile = null; in testCreateAndExtractZip_fromFiles() local 152 zipFile = ZipUtil.createZip(Arrays.asList(file1, file2)); in testCreateAndExtractZip_fromFiles() 153 ZipUtil.extractZip(new ZipFile(zipFile), extractedDir); in testCreateAndExtractZip_fromFiles() [all …]
|
D | ZipUtilFuncTest.java | 92 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()
|
D | BugreportTest.java | 154 File zipFile = null; in testBugreportz_noMainFile() local 161 zipFile = ZipUtil.createZip(new File("")); in testBugreportz_noMainFile() 162 FileOutputStream fileStream = new FileOutputStream(zipFile); in testBugreportz_noMainFile() 167 mBugreport = new Bugreport(zipFile, true); in testBugreportz_noMainFile() 171 FileUtil.deleteFile(zipFile); in testBugreportz_noMainFile()
|
D | FuseUtilTest.java | 85 File zipFile = new File("/path/to/zip"); in testMountZip() local 88 mFuseUtil.mountZip(zipFile, mountDir); in testMountZip() 95 zipFile.getAbsolutePath(), in testMountZip()
|
/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/sign/ |
D | JarSigningTest.java | 48 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/javatests/com/android/tradefed/testtype/suite/ |
D | TestMappingSuiteRunnerTest.java | 238 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTestsWhenRemoteTestTimeoutIsSet() local 239 ZipUtil.createZip(filesToZip, zipFile); in testLoadTestsWhenRemoteTestTimeoutIsSet() 244 when(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).thenReturn(zipFile); in testLoadTestsWhenRemoteTestTimeoutIsSet() 332 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZip() local 333 ZipUtil.createZip(filesToZip, zipFile); in testLoadTests_testMappingsZip() 338 when(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).thenReturn(zipFile); in testLoadTests_testMappingsZip() 397 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZipFoundTestsWithKeywords() local 398 ZipUtil.createZip(filesToZip, zipFile); in testLoadTests_testMappingsZipFoundTestsWithKeywords() 403 when(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).thenReturn(zipFile); in testLoadTests_testMappingsZipFoundTestsWithKeywords() 464 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testLoadTests_testMappingsZipFailWithKeywords() local [all …]
|
/tools/tradefederation/core/common_util/com/android/tradefed/util/zip/ |
D | EndCentralDirectoryInfo.java | 70 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/javatests/com/android/tradefed/util/testmapping/ |
D | TestMappingTest.java | 219 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testGetTests() local 220 ZipUtil.createZip(filesToZip, zipFile); in testGetTests() 221 when(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).thenReturn(zipFile); in testGetTests() 275 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testGetTests_matchKeywords() local 276 ZipUtil.createZip(filesToZip, zipFile); in testGetTests_matchKeywords() 277 when(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).thenReturn(zipFile); in testGetTests_matchKeywords() 315 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testGetTests_withIgnoreKeywords() local 316 ZipUtil.createZip(filesToZip, zipFile); in testGetTests_withIgnoreKeywords() 317 when(mockBuildInfo.getFile(TEST_MAPPINGS_ZIP)).thenReturn(zipFile); in testGetTests_withIgnoreKeywords() 644 File zipFile = Paths.get(tempDir.getAbsolutePath(), TEST_MAPPINGS_ZIP).toFile(); in testExtractTestMappingsZip() local [all …]
|
/tools/tradefederation/core/src/com/android/tradefed/util/testmapping/ |
D | TestMapping.java | 490 File zipFile; in getTests() local 492 zipFile = lookupTestMappingZip(TEST_MAPPINGS_ZIP); in getTests() 494 zipFile = buildInfo.getFile(TEST_MAPPINGS_ZIP); in getTests() 499 if (zipFile.isDirectory()) { in getTests() 500 testMappingsDir = zipFile; in getTests() 502 testMappingsDir = extractTestMappingsZip(zipFile); in getTests() 511 mergeTestMappingZips(buildInfo, extraZipNames, zipFile, testMappingsDir); in getTests() 702 File zipFile; in mergeTestMappingZips() local 704 zipFile = lookupTestMappingZip(zipName); in mergeTestMappingZips() 706 zipFile = buildInfo.getFile(zipName); in mergeTestMappingZips() [all …]
|
/tools/tradefederation/core/test_framework/com/android/tradefed/targetprep/multi/ |
D | MixImageZipPreparer.java | 359 final ZipFile zipFile, Predicate<String> predicate) throws IOException { in getInputStreamFactoriesFromImageZip() argument 361 Enumeration<? extends ZipEntry> entries = zipFile.entries(); in getInputStreamFactoriesFromImageZip() 386 return zipFile.getInputStream(entry); in getInputStreamFactoriesFromImageZip() 474 File zipFile = null; in createZip() local 477 zipFile = FileUtil.createTempFile("MixedImg", ".zip"); in createZip() 478 out = new FileOutputStream(zipFile); in createZip() 504 File returnValue = zipFile; in createZip() 505 zipFile = null; in createZip() 509 FileUtil.deleteFile(zipFile); in createZip()
|
/tools/tradefederation/core/test_framework/com/android/tradefed/targetprep/ |
D | DynamicSystemPreparer.java | 143 ZipFile zipFile = new ZipFile(imageZipFile); in getUnsparsedImageStream() local 148 zipFile.getEntry( in getUnsparsedImageStream() 155 StreamUtil.close(zipFile); in getUnsparsedImageStream() 160 new FilterInputStream(zipFile.getInputStream(entry)) { in getUnsparsedImageStream() 164 StreamUtil.close(zipFile); in getUnsparsedImageStream() 168 StreamUtil.close(zipFile); in getUnsparsedImageStream()
|
/tools/tradefederation/core/javatests/com/android/tradefed/cluster/ |
D | ClusterBuildProviderTest.java | 157 File zipFile = (File) invocation.getArgument(0); in setUpMockFuseUtil() 160 try (ZipFile zip = new ZipFile(zipFile)) { in setUpMockFuseUtil() 198 File zipFile = new File(mRootDir, ZIP_KEY); in testGetBuild_multipleTestResources() local 199 Assert.assertTrue(zipFile.isFile()); in testGetBuild_multipleTestResources() 204 .download(Mockito.any(), Mockito.eq(zipFile)); in testGetBuild_multipleTestResources() 231 File zipFile = new File(mRootDir, ZIP_KEY); in testGetBuild_decompressTestResources() local 232 Assert.assertTrue(zipFile.isFile()); in testGetBuild_decompressTestResources() 240 .download(Mockito.any(), Mockito.eq(zipFile)); in testGetBuild_decompressTestResources()
|
/tools/tradefederation/core/javatests/com/android/tradefed/config/remote/ |
D | GcsRemoteFileResolverTest.java | 128 File zipFile = ZipUtil.createZip(testDir); in testResolve_unzip() local 134 FileUtil.hardlinkFile(zipFile, destFile); in testResolve_unzip() 135 FileUtil.deleteFile(zipFile); in testResolve_unzip() 156 assertFalse(zipFile.exists()); in testResolve_unzip() 162 FileUtil.deleteFile(zipFile); in testResolve_unzip()
|
/tools/tradefederation/core/src/com/android/tradefed/build/ |
D | LocalDeviceBuildProvider.java | 170 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/core/javatests/com/android/tradefed/targetprep/multi/ |
D | MixImageZipPreparerTest.java | 519 ZipFile zipFile = null; in runCreateZipTest() local 522 zipFile = new ZipFile(file); in runCreateZipTest() 524 Assert.assertEquals(data.size(), zipFile.stream().count()); in runCreateZipTest() 527 ZipEntry actual = zipFile.getEntry(entry.getKey()); in runCreateZipTest() 538 ZipUtil.closeZip(zipFile); in runCreateZipTest()
|
/tools/tradefederation/contrib/src/com/android/performance/tests/ |
D | AppTransitionTests.java | 452 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()
|