Java Code Examples for javax.xml.crypto.URIReference#getType()

The following examples show how to use javax.xml.crypto.URIReference#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenerationTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 2
Source File: GenerationTests.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 3
Source File: ValidationTests.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 4
Source File: GenerationTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 5
Source File: ValidationTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 6
Source File: GenerationTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 7
Source File: GenerationTests.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 8
Source File: ErrorHandlerPermissions.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
    // return static content
    return new OctetStreamData(new ByteArrayInputStream(
            "<test>test</test>".getBytes()), ref.getURI(),
            ref.getType());
}
 
Example 9
Source File: ErrorHandlerPermissions.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
    // return static content
    return new OctetStreamData(new ByteArrayInputStream(
            "<test>test</test>".getBytes()), ref.getURI(),
            ref.getType());
}
 
Example 10
Source File: ValidationTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 11
Source File: GenerationTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 12
Source File: ValidationTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 13
Source File: GenerationTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 14
Source File: ValidationTests.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 15
Source File: ValidationTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 16
Source File: GenerationTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 17
Source File: ValidationTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 18
Source File: GenerationTests.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 19
Source File: GenerationTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 20
Source File: GenerationTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}