@Override public void setAVTransportURI(UnsignedIntegerFourBytes instanceId, String currentURI, String currentURIMetaData) throws AVTransportException { URI uri; try { uri = new URI(currentURI); } catch (Exception ex) { throw new AVTransportException( ErrorCode.INVALID_ARGS, "CurrentURI can not be null or malformed" ); } if (currentURI.startsWith("http:")) { try { HttpFetch.validate(URIUtil.toURL(uri)); } catch (Exception ex) { throw new AVTransportException( AVTransportErrorCode.RESOURCE_NOT_FOUND, ex.getMessage() ); } } else if (!currentURI.startsWith("file:")) { throw new AVTransportException( ErrorCode.INVALID_ARGS, "Only HTTP and file: resource identifiers are supported" ); } // TODO: Check mime type of resource against supported types // TODO: DIDL fragment parsing and handling of currentURIMetaData getInstance(instanceId).setURI(uri); }
log.fine("Preparing HTTP request message with method '" + requestOperation.getHttpMethodName() + "': " + requestMessage); URL url = URIUtil.toURL(requestOperation.getURI());
Representation representation = HttpFetch.fetch(URIUtil.toURL(uri), "HEAD", 500, 500, new HttpFetch.RepresentationFactory() { public Representation createRepresentation(URLConnection urlConnection, InputStream is) throws IOException { return new Representation(urlConnection, (Object)null);
log.fine("Preparing HTTP request message with method '" + requestOperation.getHttpMethodName() + "': " + requestMessage); URL url = URIUtil.toURL(requestOperation.getURI());
log.fine("Preparing HTTP request message with method '" + requestOperation.getHttpMethodName() + "': " + requestMessage); URL url = URIUtil.toURL(requestOperation.getURI());