8242680: Improved URI Support

Fri, 16 Oct 2020 19:55:07 +0100

author
yan
date
Fri, 16 Oct 2020 19:55:07 +0100
changeset 14214
e333a640d78f
parent 14213
cb50526a9629
child 14215
05922d77fc13

8242680: Improved URI Support
Reviewed-by: mbalao, andrew

src/solaris/classes/sun/nio/fs/UnixUriUtils.java file | annotate | diff | comparison | revisions
src/windows/classes/sun/nio/fs/WindowsUriSupport.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/solaris/classes/sun/nio/fs/UnixUriUtils.java	Tue Apr 28 10:14:25 2020 -0700
     1.2 +++ b/src/solaris/classes/sun/nio/fs/UnixUriUtils.java	Fri Oct 16 19:55:07 2020 +0100
     1.3 @@ -116,9 +116,10 @@
     1.4          // trailing slash if directory
     1.5          if (sb.charAt(sb.length()-1) != '/') {
     1.6              try {
     1.7 +                 up.checkRead();
     1.8                   if (UnixFileAttributes.get(up, true).isDirectory())
     1.9                       sb.append('/');
    1.10 -            } catch (UnixException x) {
    1.11 +            } catch (SecurityException | UnixException x) {
    1.12                  // ignore
    1.13              }
    1.14          }
     2.1 --- a/src/windows/classes/sun/nio/fs/WindowsUriSupport.java	Tue Apr 28 10:14:25 2020 -0700
     2.2 +++ b/src/windows/classes/sun/nio/fs/WindowsUriSupport.java	Fri Oct 16 19:55:07 2020 +0100
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -104,8 +104,9 @@
    2.11          boolean addSlash = false;
    2.12          if (!s.endsWith("\\")) {
    2.13              try {
    2.14 +                 path.checkRead();
    2.15                   addSlash = WindowsFileAttributes.get(path, true).isDirectory();
    2.16 -            } catch (WindowsException x) {
    2.17 +            } catch (SecurityException | WindowsException x) {
    2.18              }
    2.19          }
    2.20  

mercurial