8242680: Improved URI Support

Reviewed-by: alanb, rhalade
This commit is contained in:
Brian Burkhalter 2020-04-29 13:20:25 -07:00 committed by Henry Jen
parent ff3e558679
commit 9291e60892
2 changed files with 9 additions and 5 deletions

View file

@ -115,9 +115,12 @@ class UnixUriUtils {
// trailing slash if directory
if (sb.charAt(sb.length()-1) != '/') {
int mode = UnixNativeDispatcher.stat(up);
if ((mode & UnixConstants.S_IFMT) == UnixConstants.S_IFDIR)
sb.append('/');
try {
up.checkRead();
int mode = UnixNativeDispatcher.stat(up);
if ((mode & UnixConstants.S_IFMT) == UnixConstants.S_IFDIR)
sb.append('/');
} catch (SecurityException ignore) { }
}
try {