Java Code Examples for com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver#getAbsoluteURIFromRelative()

The following examples show how to use com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver#getAbsoluteURIFromRelative() . 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: CharInfo.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 2
Source File: CharInfo.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 3
Source File: CharInfo.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 4
Source File: CharInfo.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 5
Source File: CharInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 6
Source File: CharInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 7
Source File: CharInfo.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 8
Source File: CharInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}
 
Example 9
Source File: CharInfo.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a CharInfo object using the following process to try reading
 * the entitiesFileName parameter:
 *
 *   1) attempt to load it as a ResourceBundle
 *   2) try using the class loader to find the specified file
 *   3) try opening it as an URI
 *
 * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
 * following format:
 * <pre>
 * # First char # is a comment
 * Entity numericValue
 * quot 34
 * amp 38
 * </pre>
 *
 * @param entitiesFileName Name of entities resource file that should
 * be loaded, which describes the mapping of characters to entity references.
 * @param method the output method type, which should be one of "xml", "html", and "text".
 * @return an instance of CharInfo
 */
static CharInfo getCharInfo(String entitiesFileName, String method)
{
    try {
        return new CharInfo(entitiesFileName, method, false);
    } catch (Exception e) {}

    String absoluteEntitiesFileName;

    if (entitiesFileName.indexOf(':') < 0) {
        absoluteEntitiesFileName =
            SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
    } else {
        try {
            absoluteEntitiesFileName =
                SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
        } catch (TransformerException te) {
            throw new WrappedRuntimeException(te);
        }
    }

    return new CharInfo(absoluteEntitiesFileName, method, false);
}