Code example for URI

Methods: resolve, toString

0
        if (this.systemId != null) {
            try { 
                URI systemUri = new URI(systemId);
                if (!systemUri.isAbsolute() && !systemUri.isOpaque()) {
                    // It could be relative (or it may not be a URI at all!) 
                    URI baseUri = new URI(this.systemId);
                    systemUri = baseUri.resolve(systemUri);
 
                    // Replace systemId w/ resolved URI 
                    systemId = systemUri.toString();
                } 
            } catch (Exception e) {
                System.logI("Could not resolve '" + systemId + "' relative to"
                        + " '" + this.systemId + "' at " + locator, e);
            } 
        } 
 
        InputSource inputSource = entityResolver.resolveEntity(
                publicId, systemId);
        if (inputSource == null) {
            /*