< prev index next >

src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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.  Oracle designates this

@@ -63,18 +63,16 @@
     public String getScheme() {
         return "jrt";
     }
 
     /**
-     * Need FilePermission ${java.home}/-", "read" to create or get jrt:/
+     * Need RuntimePermission "accessSystemModules" to create or get jrt:/
      */
     private void checkPermission() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            String home = SystemImage.RUNTIME_HOME;
-            FilePermission perm
-                    = new FilePermission(home + File.separator + "-", "read");
+            RuntimePermission perm = new RuntimePermission("accessSystemModules");
             sm.checkPermission(perm);
         }
     }
 
     private void checkUri(URI uri) {
< prev index next >