changeset 14163:e333a640d78f

8242680: Improved URI Support Reviewed-by: mbalao, andrew
author yan
date Fri, 16 Oct 2020 19:55:07 +0100
parents cb50526a9629
children 05922d77fc13
files src/solaris/classes/sun/nio/fs/UnixUriUtils.java src/windows/classes/sun/nio/fs/WindowsUriSupport.java
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/nio/fs/UnixUriUtils.java	Tue Apr 28 10:14:25 2020 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixUriUtils.java	Fri Oct 16 19:55:07 2020 +0100
@@ -116,9 +116,10 @@
         // trailing slash if directory
         if (sb.charAt(sb.length()-1) != '/') {
             try {
+                 up.checkRead();
                  if (UnixFileAttributes.get(up, true).isDirectory())
                      sb.append('/');
-            } catch (UnixException x) {
+            } catch (SecurityException | UnixException x) {
                 // ignore
             }
         }
--- a/src/windows/classes/sun/nio/fs/WindowsUriSupport.java	Tue Apr 28 10:14:25 2020 -0700
+++ b/src/windows/classes/sun/nio/fs/WindowsUriSupport.java	Fri Oct 16 19:55:07 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2020, 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
@@ -104,8 +104,9 @@
         boolean addSlash = false;
         if (!s.endsWith("\\")) {
             try {
+                 path.checkRead();
                  addSlash = WindowsFileAttributes.get(path, true).isDirectory();
-            } catch (WindowsException x) {
+            } catch (SecurityException | WindowsException x) {
             }
         }