mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8242680: Improved URI Support
Reviewed-by: alanb, rhalade
This commit is contained in:
parent
ff3e558679
commit
9291e60892
2 changed files with 9 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 @@ class WindowsUriSupport {
|
|||
boolean addSlash = false;
|
||||
if (!s.endsWith("\\")) {
|
||||
try {
|
||||
path.checkRead();
|
||||
addSlash = WindowsFileAttributes.get(path, true).isDirectory();
|
||||
} catch (WindowsException x) {
|
||||
} catch (SecurityException | WindowsException x) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue