@Test(expected=IllegalArgumentException.class) public void testCreate$opaque() throws Exception { URIDescriptor.create(uri("urn:opaque:uri")); }
public static URIDescriptor create(URI target) { if(target==null) { throw new NullPointerException("URI cannot be null"); } if(target.isOpaque()) { throw new IllegalArgumentException("URI must be hierarchical"); } URI targetDir = target.resolve("."); String targetFile=target.getPath().substring(targetDir.getPath().length()); String targetQuery = target.getQuery(); String targetFragment=target.getFragment(); return new URIDescriptor(target,targetDir.getPath(),targetFile,targetQuery,targetFragment); }
URIDescriptor { public static URIDescriptor create(URI target) { if(target==null) { throw new NullPointerException("URI cannot be null"); } if(target.isOpaque()) { throw new IllegalArgumentException("URI must be hierarchical"); } URI targetDir = target.resolve("."); String targetFile=target.getPath().substring(targetDir.getPath().length()); String targetQuery = target.getQuery(); String targetFragment=target.getFragment(); return new URIDescriptor(target,targetDir.getPath(),targetFile,targetQuery,targetFragment); } }
URIDescriptor { public static URIDescriptor create(URI target) { if(target==null) { throw new NullPointerException("URI cannot be null"); } if(target.isOpaque()) { throw new IllegalArgumentException("URI must be hierarchical"); } URI targetDir = target.resolve("."); String targetFile=target.getPath().substring(targetDir.getPath().length()); String targetQuery = target.getQuery(); String targetFragment=target.getFragment(); return new URIDescriptor(target,targetDir.getPath(),targetFile,targetQuery,targetFragment); } private  URIDescriptor(
		URI uri,
		String dir,
		String file,
		String query,
		String fragment); }
URIDescriptor { public static URIDescriptor create(URI target) { if(target==null) { throw new NullPointerException("URI cannot be null"); } if(target.isOpaque()) { throw new IllegalArgumentException("URI must be hierarchical"); } URI targetDir = target.resolve("."); String targetFile=target.getPath().substring(targetDir.getPath().length()); String targetQuery = target.getQuery(); String targetFragment=target.getFragment(); return new URIDescriptor(target,targetDir.getPath(),targetFile,targetQuery,targetFragment); } private  URIDescriptor(
		URI uri,
		String dir,
		String file,
		String query,
		String fragment); URI getUri(); String getDir(); String getFile(); boolean isDir(); String getQuery(); String getFragment(); @Override String toString(); static URIDescriptor create(URI target); }
URIDescriptor { public static URIDescriptor create(URI target) { if(target==null) { throw new NullPointerException("URI cannot be null"); } if(target.isOpaque()) { throw new IllegalArgumentException("URI must be hierarchical"); } URI targetDir = target.resolve("."); String targetFile=target.getPath().substring(targetDir.getPath().length()); String targetQuery = target.getQuery(); String targetFragment=target.getFragment(); return new URIDescriptor(target,targetDir.getPath(),targetFile,targetQuery,targetFragment); } private  URIDescriptor(
		URI uri,
		String dir,
		String file,
		String query,
		String fragment); URI getUri(); String getDir(); String getFile(); boolean isDir(); String getQuery(); String getFragment(); @Override String toString(); static URIDescriptor create(URI target);  }