# HG changeset patch # User bpb # Date 1588191625 25200 # Node ID 245d5bd872ed2c22c6de809ddde586cc8ddf2ee5 # Parent dd1fbe9cc20d8950f08f48478b584f7c82899059 8242680: Improved URI Support Reviewed-by: alanb, rhalade diff -r dd1fbe9cc20d -r 245d5bd872ed src/solaris/classes/sun/nio/fs/UnixUriUtils.java --- 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 Wed Apr 29 13:20:25 2020 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, 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 @@ -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 } } diff -r dd1fbe9cc20d -r 245d5bd872ed src/windows/classes/sun/nio/fs/WindowsUriSupport.java --- 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 Wed Apr 29 13:20:25 2020 -0700 @@ -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) { } }