8145988: Use the raw methods of java.net.URI when possible

Reviewed-by: shade, chegar
This commit is contained in:
Claes Redestad 2015-12-22 16:42:16 +01:00
parent 7e4d56677d
commit 22df7c453f
5 changed files with 21 additions and 19 deletions

View file

@ -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");
}