/** * Creates an {@code OnlineResource} element if the given URL is not null. Since ISO 19115 * declares the URL as a mandatory attribute, this method will ignore all other attributes * if the given URL is null. * * @param url the URL (mandatory - if {@code null}, no resource will be created). * @return the online resource, or {@code null} if the URL was null. */ private OnlineResource createOnlineResource(final String url) { final URI uri = createURI(url); if (uri == null) { return null; } final DefaultOnlineResource resource = new DefaultOnlineResource(uri); final String protocol = uri.getScheme(); resource.setProtocol(protocol); if ("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) { resource.setApplicationProfile("web browser"); } resource.setFunction(OnLineFunction.INFORMATION); return resource; }
/** * Creates an {@code OnlineResource} element if the given URL is not null. Since ISO 19115 * declares the URL as a mandatory attribute, this method will ignore all other attributes * if the given URL is null. * * @param url the URL (mandatory - if {@code null}, no resource will be created). * @return the online resource, or {@code null} if the URL was null. */ private OnlineResource createOnlineResource(final String url) { final URI uri = createURI(url); if (uri == null) { return null; } final DefaultOnlineResource resource = new DefaultOnlineResource(uri); final String protocol = uri.getScheme(); resource.setProtocol(protocol); if ("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) { resource.setApplicationProfile("web browser"); } resource.setFunction(OnLineFunction.INFORMATION); return resource; }