< prev index next >

test/jdk/jdk/nio/zipfs/ZipFSTester.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 79,89 **** * @run main ZipFSTester * @run main/othervm/java.security.policy=test.policy ZipFSTester */ public class ZipFSTester { - public static void main(String[] args) throws Exception { // create JAR file for test, actual contents don't matter Path jarFile = Utils.createJarFile("tester.jar", "META-INF/MANIFEST.MF", "dir1/foo", --- 79,88 ----
*** 144,154 **** z2zcopy(fs0, copy, "/", 0); // copy the test jar itself in Files.copy(Paths.get(fs0.toString()), copy.getPath("/foo.jar")); Path zpath = copy.getPath("/foo.jar"); ! try (FileSystem zzfs = FileSystems.newFileSystem(zpath, null)) { Files.copy(src, zzfs.getPath("/srcInjarjar")); } } try (FileSystem fs = newZipFileSystem(tmpfsPath, new HashMap<String, Object>())) { --- 143,153 ---- z2zcopy(fs0, copy, "/", 0); // copy the test jar itself in Files.copy(Paths.get(fs0.toString()), copy.getPath("/foo.jar")); Path zpath = copy.getPath("/foo.jar"); ! try (FileSystem zzfs = FileSystems.newFileSystem(zpath, (ClassLoader)null)) { Files.copy(src, zzfs.getPath("/srcInjarjar")); } } try (FileSystem fs = newZipFileSystem(tmpfsPath, new HashMap<String, Object>())) {
*** 252,262 **** Files.delete(dst); // test foo.jar in jar/zipfs #8034802 Path jpath = fs.getPath("/foo.jar"); System.out.println("walking: " + jpath); ! try (FileSystem zzfs = FileSystems.newFileSystem(jpath, null)) { walk(zzfs.getPath("/")); // foojar:/srcInjarjar checkEqual(src, zzfs.getPath("/srcInjarjar")); dst = getPathWithParents(zzfs, tmpName); --- 251,261 ---- Files.delete(dst); // test foo.jar in jar/zipfs #8034802 Path jpath = fs.getPath("/foo.jar"); System.out.println("walking: " + jpath); ! try (FileSystem zzfs = FileSystems.newFileSystem(jpath, (ClassLoader)null)) { walk(zzfs.getPath("/")); // foojar:/srcInjarjar checkEqual(src, zzfs.getPath("/srcInjarjar")); dst = getPathWithParents(zzfs, tmpName);
< prev index next >