test/jdk/nio/zipfs/PathOps.java
Print this page
*** 19,41 ****
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
- import java.nio.file.*;
- import java.net.*;
- import java.util.*;
import java.io.IOException;
/**
*
* @test
* @bug 8038500 8040059
* @summary Tests path operations for zip provider.
*
* @run main PathOps
! * @run main/othervm/java.security.policy=test.policy.readonly PathOps
*/
public class PathOps {
static final java.io.PrintStream out = System.out;
--- 19,43 ----
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.IOException;
+ import java.nio.file.FileSystem;
+ import java.nio.file.FileSystems;
+ import java.nio.file.Files;
+ import java.nio.file.InvalidPathException;
+ import java.nio.file.Path;
/**
*
* @test
* @bug 8038500 8040059
* @summary Tests path operations for zip provider.
*
* @run main PathOps
! * @run main/othervm/java.security.policy=test.policy PathOps
*/
public class PathOps {
static final java.io.PrintStream out = System.out;
*** 450,463 ****
} catch (NullPointerException npe) {
}
}
! public static void main(String[] args) throws Throwable {
! Path zipfile = Paths.get(System.getProperty("test.jdk"),
! "jre/lib/ext/zipfs.jar");
! fs = FileSystems.newFileSystem(zipfile, null);
npes();
doPathOpTests();
fs.close();
}
}
--- 452,469 ----
} catch (NullPointerException npe) {
}
}
! public static void main(String[] args) throws IOException {
! // create empty JAR file, test doesn't require any contents
! Path emptyJar = Utils.createJarFile("empty.jar");
!
! fs = FileSystems.newFileSystem(emptyJar, null);
! try {
npes();
doPathOpTests();
+ } finally {
fs.close();
}
}
+ }