Java 8 URIReference - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 URIReference class.

This code example shows how to use the following methods:getURI
        if (!(uriReference instanceof DOMURIReference && context instanceof DOMCryptoContext)) {
            throw new IllegalArgumentException(String.format("This %s implementation supports the DOM XML mechanism only.",
                    URIDereferencer.class.getName()));
        } 
 
        String uriString = uriReference.getURI();
 
        if (uriString == null) {
            throw new URIReferenceException("Cannot resolve a URI of value 'null'.");
        } 
 
        if (uriString != null && ((uriString.length() != 0 && uriString.charAt(0) == '#') || uriString.isEmpty())) {
            // same document uri 
            XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
            return fac.getURIDereferencer().dereference(uriReference, context);
        } 
 
        throw new URIReferenceException(String.format("URI reference %s not supported", uriString));
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getURI, getId
    public void end() throws Exception { //NOPMD
        error = null;
    } 
 
    private String getReferenceUriOrId(Reference ref) {
        String docId = ref.getURI();
        if (docId == null) {
            docId = ref.getId();
        } 
        return docId;
    } 
 
    @Override 
    public boolean ignoreCoreValidationFailure() throws Exception { //NOPMD
        return false; 
    } 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getType, getTransforms, getURI
This code example shows how to use the following methods:getURI
            } 
        } 
    } 
 
    protected String getSameDocumentReferenceUri(Reference ref) {
        String refUri = ref.getURI();
        if (refUri == null) {
            LOG.warn("Ignoring reference {} which has no URI", ref);
            return null; 
        } 
        if (!refUri.startsWith("#")) {
            LOG.warn("Ignoring non-same document reference {}", refUri);
            return null; 
        } 
        return refUri.substring(1);
    } 
 
    protected Manifest getReferencedManifest(List<XMLObject> objects, String id) {
        for (XMLObject xo : objects) {
            @SuppressWarnings("unchecked") 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getType, getURI
            defaultUd = XMLSignatureFactory.getInstance().getURIDereferencer();
        } 
 
        public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
            String uri = ref.getURI();
            if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
                try { 
                    FileInputStream fis = new FileInputStream(new File
                        (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
                    return new OctetStreamData(fis,ref.getURI(),ref.getType());
                } catch (Exception e) { throw new URIReferenceException(e); }
            } 
 
            // fallback on builtin deref 
            return defaultUd.dereference(ref, ctx);
        } 
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getType, getURI
    } 
 
    @Override 
    public Data dereference(final URIReference uriReference, final XMLCryptoContext context) throws URIReferenceException {
 
        String uri = uriReference.getURI();
        // TODO: Following the test case: XAdESTest003 test: testTDetached() the URI can be like: should we accept this URI and what about the baseURI ? 
        // <ds:Reference Id="Reference0" URI="./TARGET_BBB.bin"> 
        // The following rule was added to comply this functionality: 
        // BEGIN: 
        if (uri.startsWith("./")) {
 
            uri = uri.substring(2);
        } 
        // :END 
        if (!uri.equals(documentURI)) {
 
            final URIDereferencer uriDereferencer = factory.getURIDereferencer();
            final Data data = uriDereferencer.dereference(uriReference, context);
            if (LOG.isInfoEnabled()) { 

4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getType, getURI
            defaultUd = XMLSignatureFactory.getInstance().getURIDereferencer();
        } 
 
        public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
            String uri = ref.getURI();
            if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
                try { 
                    FileInputStream fis = new FileInputStream(new File
                        (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
                    return new OctetStreamData(fis,ref.getURI(),ref.getType());
                } catch (Exception e) { throw new URIReferenceException(e); }
            } 
 
            // fallback on builtin deref 
            return defaultUd.dereference(ref, ctx);
        } 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 URIReference Methods: