private InputSource createClassloaderInputSource(String publicId, String systemId) { InputStream inStream = ClassUtils.getResourceAsStream(systemId); if (inStream == null) { // there is no such entity return null; } InputSource is = new InputSource(inStream); is.setPublicId(publicId); is.setSystemId(systemId); //the next line was removed - encoding should be determined automatically out of the inputStream //encoding should be determined automatically out of the inputStream //DEFAULT_ENCODING was ISO-8859-1 //is.setEncoding(DEFAULT_ENCODING); return is; }
private InputSource createClassloaderInputSource(String publicId, String systemId) { InputStream inStream = ClassUtils.getResourceAsStream(systemId); if (inStream == null) { // there is no such entity return null; } InputSource is = new InputSource(inStream); is.setPublicId(publicId); is.setSystemId(systemId); //the next line was removed - encoding should be determined automatically out of the inputStream //encoding should be determined automatically out of the inputStream //DEFAULT_ENCODING was ISO-8859-1 //is.setEncoding(DEFAULT_ENCODING); return is; }
private static Source getFaceletSchemaFileAsSource(ExternalContext externalContext) { InputStream stream = ClassUtils.getResourceAsStream(FACES_TAGLIB_SCHEMA_PATH); if (stream == null) { stream = externalContext.getResourceAsStream(FACES_TAGLIB_SCHEMA_PATH); } if (stream == null) { return null; } return new StreamSource(stream); }
private static Source getFacesConfigSchemaFileAsSource(ExternalContext externalContext, String version) { String xmlSchema = "1.2".equals(version) ? FACES_CONFIG_SCHEMA_PATH_12 : FACES_CONFIG_SCHEMA_PATH_20; InputStream stream = ClassUtils.getResourceAsStream(xmlSchema); if (stream == null) { stream = externalContext.getResourceAsStream(xmlSchema); } if (stream == null) { return null; } return new StreamSource(stream); }
private static Source getFaceletSchemaFileAsSource(ExternalContext externalContext) { InputStream stream = ClassUtils.getResourceAsStream(FACES_TAGLIB_SCHEMA_PATH); if (stream == null) { stream = externalContext.getResourceAsStream(FACES_TAGLIB_SCHEMA_PATH); } if (stream == null) { return null; } return new StreamSource(stream); }
private static Source getFacesConfigSchemaFileAsSource(ExternalContext externalContext, String version) { String xmlSchema = "1.2".equals(version) ? FACES_CONFIG_SCHEMA_PATH_12 : ("2.0".equals(version) ? FACES_CONFIG_SCHEMA_PATH_20 : FACES_CONFIG_SCHEMA_PATH_21) ; InputStream stream = ClassUtils.getResourceAsStream(xmlSchema); if (stream == null) { stream = externalContext.getResourceAsStream(xmlSchema); } if (stream == null) { return null; } return new StreamSource(stream); }
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { if ("http://www.w3.org/TR/REC-xml".equals(type) && "datatypes.dtd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/datatypes.dtd")); } if ("-//W3C//DTD XMLSCHEMA 200102//EN".equals(publicId) && "XMLSchema.dtd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/XMLSchema.dtd")); } if ("http://java.sun.com/xml/ns/javaee".equals(namespaceURI)) { if ("javaee_5.xsd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/javaee_5.xsd")); } else if ("javaee_web_services_client_1_2.xsd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/javaee_web_services_client_1_2.xsd")); } } if ("http://www.w3.org/XML/1998/namespace".equals(namespaceURI)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/xml.xsd")); } return null; }
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { if ("http://www.w3.org/TR/REC-xml".equals(type) && "datatypes.dtd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/datatypes.dtd")); } if ("-//W3C//DTD XMLSCHEMA 200102//EN".equals(publicId) && "XMLSchema.dtd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/XMLSchema.dtd")); } if ("http://java.sun.com/xml/ns/javaee".equals(namespaceURI)) { if ("javaee_5.xsd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/javaee_5.xsd")); } else if ("javaee_web_services_client_1_2.xsd".equals(systemId)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/javaee_web_services_client_1_2.xsd")); } } if ("http://www.w3.org/XML/1998/namespace".equals(namespaceURI)) { return new LSInputImpl(publicId, systemId, baseURI, ClassUtils.getResourceAsStream("org/apache/myfaces/resource/xml.xsd")); } return null; }
if (systemId.equals(FACES_CONFIG_1_0_DTD_SYSTEM_ID)) stream = ClassUtils.getResourceAsStream(FACES_CONFIG_1_0_DTD_RESOURCE); stream = ClassUtils.getResourceAsStream(FACES_CONFIG_1_1_DTD_RESOURCE); stream = ClassUtils.getResourceAsStream(systemId);
if (systemId.equals(FACES_CONFIG_1_0_DTD_SYSTEM_ID)) stream = ClassUtils.getResourceAsStream(FACES_CONFIG_1_0_DTD_RESOURCE); stream = ClassUtils.getResourceAsStream(FACES_CONFIG_1_1_DTD_RESOURCE); stream = ClassUtils.getResourceAsStream(systemId);
if (systemId.equals(FACES_CONFIG_1_0_DTD_SYSTEM_ID)) stream = ClassUtils.getResourceAsStream(FACES_CONFIG_1_0_DTD_RESOURCE); stream = ClassUtils.getResourceAsStream(FACES_CONFIG_1_1_DTD_RESOURCE); stream = ClassUtils.getResourceAsStream(systemId);
private void feedStandardConfig() throws IOException, SAXException { InputStream stream = ClassUtils.getResourceAsStream(STANDARD_FACES_CONFIG_RESOURCE); if (stream == null) throw new FacesException("Standard faces config " + STANDARD_FACES_CONFIG_RESOURCE + " not found"); if (log.isInfoEnabled()) log.info("Reading standard config " + STANDARD_FACES_CONFIG_RESOURCE); getDispenser().feed(getUnmarshaller().getFacesConfig(stream, STANDARD_FACES_CONFIG_RESOURCE)); stream.close(); }
InputStream stream = ClassUtils.getResourceAsStream(STANDARD_FACES_CONFIG_RESOURCE); if (stream == null) throw new FacesException("Standard faces config " + STANDARD_FACES_CONFIG_RESOURCE + " not found");
InputStream stream = ClassUtils.getResourceAsStream(STANDARD_FACES_CONFIG_RESOURCE); if (stream == null) throw new FacesException("Standard faces config " + STANDARD_FACES_CONFIG_RESOURCE + " not found");