Java Code Examples for com.sun.org.apache.xerces.internal.util.URI#MalformedURIException

The following examples show how to use com.sun.org.apache.xerces.internal.util.URI#MalformedURIException . 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: AnyURIDV.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
    // check 3.2.17.c0 must: URI (rfc 2396/2723)
    try {
        if( content.length() != 0 ) {
            // encode special characters using XLink 5.4 algorithm
            final String encoded = encode(content);
            // Support for relative URLs
            // According to Java 1.1: URLs may also be specified with a
            // String and the URL object that it is related to.
            new URI(BASE_URI, encoded );
        }
    } catch (URI.MalformedURIException ex) {
        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
    }

    // REVISIT: do we need to return the new URI object?
    return content;
}
 
Example 2
Source File: AnyURIDV.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
    // check 3.2.17.c0 must: URI (rfc 2396/2723)
    try {
        if( content.length() != 0 ) {
            // encode special characters using XLink 5.4 algorithm
            final String encoded = encode(content);
            // Support for relative URLs
            // According to Java 1.1: URLs may also be specified with a
            // String and the URL object that it is related to.
            new URI(BASE_URI, encoded );
        }
    } catch (URI.MalformedURIException ex) {
        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
    }

    // REVISIT: do we need to return the new URI object?
    return content;
}
 
Example 3
Source File: AnyURIDV.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
    // check 3.2.17.c0 must: URI (rfc 2396/2723)
    try {
        if( content.length() != 0 ) {
            // encode special characters using XLink 5.4 algorithm
            final String encoded = encode(content);
            // Support for relative URLs
            // According to Java 1.1: URLs may also be specified with a
            // String and the URL object that it is related to.
            new URI(BASE_URI, encoded );
        }
    } catch (URI.MalformedURIException ex) {
        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
    }

    // REVISIT: do we need to return the new URI object?
    return content;
}
 
Example 4
Source File: AnyURIDV.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
    // check 3.2.17.c0 must: URI (rfc 2396/2723)
    try {
        if( content.length() != 0 ) {
            // encode special characters using XLink 5.4 algorithm
            final String encoded = encode(content);
            // Support for relative URLs
            // According to Java 1.1: URLs may also be specified with a
            // String and the URL object that it is related to.
            new URI(BASE_URI, encoded );
        }
    } catch (URI.MalformedURIException ex) {
        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
    }

    // REVISIT: do we need to return the new URI object?
    return content;
}
 
Example 5
Source File: AnyURIDV.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
    // check 3.2.17.c0 must: URI (rfc 2396/2723)
    try {
        if( content.length() != 0 ) {
            // encode special characters using XLink 5.4 algorithm
            final String encoded = encode(content);
            // Support for relative URLs
            // According to Java 1.1: URLs may also be specified with a
            // String and the URL object that it is related to.
            new URI(BASE_URI, encoded );
        }
    } catch (URI.MalformedURIException ex) {
        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
    }

    // REVISIT: do we need to return the new URI object?
    return content;
}
 
Example 6
Source File: AnyURIDV.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
    // check 3.2.17.c0 must: URI (rfc 2396/2723)
    try {
        if( content.length() != 0 ) {
            // encode special characters using XLink 5.4 algorithm
            final String encoded = encode(content);
            // Support for relative URLs
            // According to Java 1.1: URLs may also be specified with a
            // String and the URL object that it is related to.
            new URI(BASE_URI, encoded );
        }
    } catch (URI.MalformedURIException ex) {
        throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
    }

    // REVISIT: do we need to return the new URI object?
    return content;
}
 
Example 7
Source File: ValidatorHandlerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 8
Source File: ValidatorHandlerImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 9
Source File: ValidatorHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 10
Source File: ValidatorHandlerImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 11
Source File: ValidatorHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 12
Source File: ValidatorHandlerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 13
Source File: ValidatorHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 14
Source File: ValidatorHandlerImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
    try {
        return XMLEntityManager.expandSystemId(systemId, baseURI, false);
    }
    // In the event that resolution failed against the
    // base URI, just return the system id as is. There's not
    // much else we can do.
    catch (URI.MalformedURIException ex) {
        return systemId;
    }
}
 
Example 15
Source File: XMLEntityManager.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Absolutizes a URI using the current value
 * of the "user.dir" property as the base URI. If
 * the URI is already absolute, this is a no-op.
 *
 * @param uri the URI to absolutize
 */
public static void absolutizeAgainstUserDir(URI uri)
    throws URI.MalformedURIException {
    uri.absolutize(getUserDir());
}
 
Example 16
Source File: XMLEntityManager.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Absolutizes a URI using the current value
 * of the "user.dir" property as the base URI. If
 * the URI is already absolute, this is a no-op.
 *
 * @param uri the URI to absolutize
 */
public static void absolutizeAgainstUserDir(URI uri)
    throws URI.MalformedURIException {
    uri.absolutize(getUserDir());
}
 
Example 17
Source File: XMLEntityManager.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Absolutizes a URI using the current value
 * of the "user.dir" property as the base URI. If
 * the URI is already absolute, this is a no-op.
 *
 * @param uri the URI to absolutize
 */
public static void absolutizeAgainstUserDir(URI uri)
    throws URI.MalformedURIException {
    uri.absolutize(getUserDir());
}
 
Example 18
Source File: XMLEntityManager.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * Absolutizes a URI using the current value
 * of the "user.dir" property as the base URI. If
 * the URI is already absolute, this is a no-op.
 *
 * @param uri the URI to absolutize
 */
public static void absolutizeAgainstUserDir(URI uri)
    throws URI.MalformedURIException {
    uri.absolutize(getUserDir());
}
 
Example 19
Source File: XMLEntityManager.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Absolutizes a URI using the current value
 * of the "user.dir" property as the base URI. If
 * the URI is already absolute, this is a no-op.
 *
 * @param uri the URI to absolutize
 */
public static void absolutizeAgainstUserDir(URI uri)
    throws URI.MalformedURIException {
    uri.absolutize(getUserDir());
}
 
Example 20
Source File: XMLEntityManager.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Absolutizes a URI using the current value
 * of the "user.dir" property as the base URI. If
 * the URI is already absolute, this is a no-op.
 *
 * @param uri the URI to absolutize
 */
public static void absolutizeAgainstUserDir(URI uri)
    throws URI.MalformedURIException {
    uri.absolutize(getUserDir());
}