mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8145988: Use the raw methods of java.net.URI when possible
Reviewed-by: shade, chegar
This commit is contained in:
parent
7e4d56677d
commit
22df7c453f
5 changed files with 21 additions and 19 deletions
|
@ -69,15 +69,16 @@ public abstract class UnixFileSystemProvider
|
|||
private void checkUri(URI uri) {
|
||||
if (!uri.getScheme().equalsIgnoreCase(getScheme()))
|
||||
throw new IllegalArgumentException("URI does not match this provider");
|
||||
if (uri.getAuthority() != null)
|
||||
if (uri.getRawAuthority() != null)
|
||||
throw new IllegalArgumentException("Authority component present");
|
||||
if (uri.getPath() == null)
|
||||
String path = uri.getPath();
|
||||
if (path == null)
|
||||
throw new IllegalArgumentException("Path component is undefined");
|
||||
if (!uri.getPath().equals("/"))
|
||||
if (!path.equals("/"))
|
||||
throw new IllegalArgumentException("Path component should be '/'");
|
||||
if (uri.getQuery() != null)
|
||||
if (uri.getRawQuery() != null)
|
||||
throw new IllegalArgumentException("Query component present");
|
||||
if (uri.getFragment() != null)
|
||||
if (uri.getRawFragment() != null)
|
||||
throw new IllegalArgumentException("Fragment component present");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue