- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.commons.io.input.XmlStreamReaderException
类的一些代码示例,展示了XmlStreamReaderException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlStreamReaderException
类的具体详情如下:
包路径:org.apache.commons.io.input.XmlStreamReaderException
类名称:XmlStreamReaderException
[英]The XmlStreamReaderException is thrown by the XmlStreamReader constructors if the charset encoding can not be determined according to the XML 1.0 specification and RFC 3023.
The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the stream. Note that the original InputStream given to the XmlStreamReader cannot be used as that one has been already read.
[中]如果无法根据XML 1.0规范和RFC 3023确定字符集编码,XmlStreamReader构造函数将引发XmlStreamReaderException。
该异常返回未使用的InputStream,以允许应用程序对该流进行替代处理。请注意,无法使用提供给XmlStreamReader的原始InputStream,因为该InputStream已被读取。
代码示例来源:origin: commons-io/commons-io
/**
* Do lenient detection.
*
* @param httpContentType content-type header to use for the resolution of
* the charset encoding.
* @param ex The thrown exception
* @return the encoding
* @throws IOException thrown if there is a problem reading the stream.
*/
private String doLenientDetection(String httpContentType,
XmlStreamReaderException ex) throws IOException {
if (httpContentType != null && httpContentType.startsWith("text/html")) {
httpContentType = httpContentType.substring("text/html".length());
httpContentType = "text/xml" + httpContentType;
try {
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
} catch (final XmlStreamReaderException ex2) {
ex = ex2;
}
}
String encoding = ex.getXmlEncoding();
if (encoding == null) {
encoding = ex.getContentTypeEncoding();
}
if (encoding == null) {
encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
}
return encoding;
}
代码示例来源:origin: commons-io/commons-io
if (xmlGuessEnc != null && !xmlGuessEnc.equals(UTF_8)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: commons-io/commons-io
private void checkRawError(final String msgSuffix,
final String bomEnc, final String xmlGuessEnc, final String xmlEnc, final String defaultEncoding) {
try {
checkRawEncoding("XmlStreamReaderException", bomEnc, xmlGuessEnc, xmlEnc, defaultEncoding);
fail("Expected XmlStreamReaderException");
} catch (final XmlStreamReaderException e) {
assertTrue("Msg Start: " + e.getMessage(), e.getMessage().startsWith("Invalid encoding"));
assertTrue("Msg End: " + e.getMessage(), e.getMessage().endsWith(msgSuffix));
assertEquals("bomEnc", bomEnc, e.getBomEncoding());
assertEquals("xmlGuessEnc", xmlGuessEnc, e.getXmlGuessEncoding());
assertEquals("xmlEnc", xmlEnc, e.getXmlEncoding());
assertNull("ContentTypeEncoding", e.getContentTypeEncoding());
assertNull("ContentTypeMime", e.getContentTypeMime());
} catch (final Exception e) {
fail("Expected XmlStreamReaderException, but threw " + e);
}
}
代码示例来源:origin: Nextdoor/bender
/**
* Do lenient detection.
*
* @param httpContentType content-type header to use for the resolution of
* the charset encoding.
* @param ex The thrown exception
* @return the encoding
* @throws IOException thrown if there is a problem reading the stream.
*/
private String doLenientDetection(String httpContentType,
XmlStreamReaderException ex) throws IOException {
if (httpContentType != null && httpContentType.startsWith("text/html")) {
httpContentType = httpContentType.substring("text/html".length());
httpContentType = "text/xml" + httpContentType;
try {
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
} catch (XmlStreamReaderException ex2) {
ex = ex2;
}
}
String encoding = ex.getXmlEncoding();
if (encoding == null) {
encoding = ex.getContentTypeEncoding();
}
if (encoding == null) {
encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
}
return encoding;
}
代码示例来源:origin: commons-io/commons-io
private void checkHttpError(final String msgSuffix, final boolean lenient, final String httpContentType,
final String bomEnc, final String xmlGuessEnc, final String xmlEnc, final String defaultEncoding) {
try {
checkHttpEncoding("XmlStreamReaderException", lenient, httpContentType, bomEnc, xmlGuessEnc, xmlEnc, defaultEncoding);
fail("Expected XmlStreamReaderException");
} catch (final XmlStreamReaderException e) {
assertTrue("Msg Start: " + e.getMessage(), e.getMessage().startsWith("Invalid encoding"));
assertTrue("Msg End: " + e.getMessage(), e.getMessage().endsWith(msgSuffix));
assertEquals("bomEnc", bomEnc, e.getBomEncoding());
assertEquals("xmlGuessEnc", xmlGuessEnc, e.getXmlGuessEncoding());
assertEquals("xmlEnc", xmlEnc, e.getXmlEncoding());
assertEquals("ContentTypeEncoding", XmlStreamReader.getContentTypeEncoding(httpContentType),
e.getContentTypeEncoding());
assertEquals("ContentTypeMime", XmlStreamReader.getContentTypeMime(httpContentType),
e.getContentTypeMime());
} catch (final Exception e) {
fail("Expected XmlStreamReaderException, but threw " + e);
}
}
代码示例来源:origin: commons-io/commons-io
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
final String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
final String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Do lenient detection.
*
* @param httpContentType content-type header to use for the resolution of
* the charset encoding.
* @param ex The thrown exception
* @return the encoding
* @throws IOException thrown if there is a problem reading the stream.
*/
private String doLenientDetection(String httpContentType,
XmlStreamReaderException ex) throws IOException {
if (httpContentType != null && httpContentType.startsWith("text/html")) {
httpContentType = httpContentType.substring("text/html".length());
httpContentType = "text/xml" + httpContentType;
try {
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
} catch (final XmlStreamReaderException ex2) {
ex = ex2;
}
}
String encoding = ex.getXmlEncoding();
if (encoding == null) {
encoding = ex.getContentTypeEncoding();
}
if (encoding == null) {
encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
}
return encoding;
}
代码示例来源:origin: Nextdoor/bender
if (xmlGuessEnc != null && !xmlGuessEnc.equals(UTF_8)) {
String msg = MessageFormat.format(RAW_EX_1, new Object[] { bomEnc, xmlGuessEnc, xmlEnc });
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
String msg = MessageFormat.format(RAW_EX_1, new Object[] { bomEnc, xmlGuessEnc, xmlEnc });
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded
/**
* Do lenient detection.
*
* @param httpContentType content-type header to use for the resolution of
* the charset encoding.
* @param ex The thrown exception
* @return the encoding
* @throws IOException thrown if there is a problem reading the stream.
*/
private String doLenientDetection(String httpContentType,
XmlStreamReaderException ex) throws IOException {
if (httpContentType != null && httpContentType.startsWith("text/html")) {
httpContentType = httpContentType.substring("text/html".length());
httpContentType = "text/xml" + httpContentType;
try {
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
} catch (final XmlStreamReaderException ex2) {
ex = ex2;
}
}
String encoding = ex.getXmlEncoding();
if (encoding == null) {
encoding = ex.getContentTypeEncoding();
}
if (encoding == null) {
encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
}
return encoding;
}
代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded
if (xmlGuessEnc != null && !xmlGuessEnc.equals(UTF_8)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: org.onosproject/onlab-thirdparty
/**
* Do lenient detection.
*
* @param httpContentType content-type header to use for the resolution of
* the charset encoding.
* @param ex The thrown exception
* @return the encoding
* @throws IOException thrown if there is a problem reading the stream.
*/
private String doLenientDetection(String httpContentType,
XmlStreamReaderException ex) throws IOException {
if (httpContentType != null && httpContentType.startsWith("text/html")) {
httpContentType = httpContentType.substring("text/html".length());
httpContentType = "text/xml" + httpContentType;
try {
return calculateHttpEncoding(httpContentType, ex.getBomEncoding(),
ex.getXmlGuessEncoding(), ex.getXmlEncoding(), true);
} catch (XmlStreamReaderException ex2) {
ex = ex2;
}
}
String encoding = ex.getXmlEncoding();
if (encoding == null) {
encoding = ex.getContentTypeEncoding();
}
if (encoding == null) {
encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
}
return encoding;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
if (xmlGuessEnc != null && !xmlGuessEnc.equals(UTF_8)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
final String msg = MessageFormat.format(RAW_EX_1, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: org.onosproject/onlab-thirdparty
if (xmlGuessEnc != null && !xmlGuessEnc.equals(UTF_8)) {
String msg = MessageFormat.format(RAW_EX_1, new Object[] { bomEnc, xmlGuessEnc, xmlEnc });
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
String msg = MessageFormat.format(RAW_EX_1, new Object[] { bomEnc, xmlGuessEnc, xmlEnc });
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
if (xmlGuessEnc != null && !xmlGuessEnc.equals(bomEnc)) {
String msg = MessageFormat.format(RAW_EX_1, new Object[] { bomEnc, xmlGuessEnc, xmlEnc });
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
final String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
final String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
final String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
final String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: org.onosproject/onlab-thirdparty
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
代码示例来源:origin: Nextdoor/bender
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
if (bomEnc != null) {
String msg = MessageFormat.format(HTTP_EX_1, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
throw new XmlStreamReaderException(msg, cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc);
我有两个文本输入元素 A 和 B。 我希望用户能够从 A 中选择部分或全部文本并拖动到 B,但文本不会从 A 中消失。 假设“A”包含“quick brown fox”,用户突出显示“fox”一词并将
我正在一个网站上工作,如果在提交表单之前数字不在最小值和最大值之间,我希望数字输入能够自行更正。我的代码如下: HTML: JavaScript: function CorrectOverUnder
在检查输入值是否存在并将其分配给变量时,我看到了两种实现此目的的方法: if(Input::has('id')) { $id = Input::get('id'); // do som
我意识到 有一个 border-box盒子模型,而有一个 content-box盒子模型。此行为存在于 IE8 和 FF 中。不幸的是,这使我无法将这种样式应用于大小均匀的输入: input, tex
在 Polymer 文档 ( https://elements.polymer-project.org/elements/iron-input ) 中,我发现: 而在另一个官方文档(https://
我使用 jquery 添加/删除输入 我使用append为日期/收入添加多个Tr 我还使用另一个附加来添加多个 td 以获取同一日期 Tr 中的收入 我添加多个日期输入,并在此表中添加多个收入输入 我
Python3 的 input() 似乎在两次调用 input() 之间采用旧的 std 输入。有没有办法忽略旧输入,只接受新输入(在 input() 被调用之后)? import time a =
在一些教程中,我看到了这些选择器: $(':input'); 或 $('input'); 注意“:”。 有什么不同吗? 最佳答案 $('input') = 仅包含元素名称,仅选择 HTML 元素。 $
我有下一个 html 表单: Nombre: El nombre es obligatorio. Solo se pe
有两种方法可以在组件上定义输入: @Component({ inputs: ['displayEntriesCount'], ... }) export class MyTable i
input: dynamic input is missing dimensions in profile onnx2trt代码报错: import numpy as np import tensor
所以,我有允许两个输入的代码: a, b = input("Enter a command: ").split() if(a == 'hello'): print("Hi") elif(a =
我有一个与用户交流的程序。我正在使用 input() 从用户那里获取数据,但是,我想告诉用户,例如,如果用户输入脏话,我想打印 You are swearing!立即删除它! 而 用户正在输入。 如您
我在运行 J2ME 应用程序时遇到了一些严重的内存问题。 所以我建立了另一个步骤来清除巨大的输入字符串并处理它的数据并清除它。但直到我设置 input = null 而不是 input = "" 才解
我想在我的 android 虚拟设备中同时启用软输入和硬键盘。我知道如何两者兼得,但不会两者。 同时想要BOTH的原因: 软输入:预览当键盘缩小屏幕时布局如何调整大小 硬键盘:显然是快速输入。 提前致
我有一个邮政编码字段,在 keyup 上我执行了一个 ajax 调用。如果没有可用的邮政编码,那么我想添加类“input-invalid”。但问题是,在我单击输入字段的外部 某处之前,红色边框验证不会
根据我的理解使用 @Input() name: string; 并在组件装饰器中使用输入数组,如下所示 @Component({ ... inputs:
我有一段代码是这样的 @Component({ selector: 'control-messages', inputs: ['controlName: control'],
在@component中, @input 和@output 属性代表什么以及它们的用途是什么? 什么是指令,为什么我们必须把指令放在下面的结构中? directives:[CORE_DIRECTIVE
有没有一种方法可以测试变量是否会使SAS中的INPUT转换过程失败?或者,是否可以避免生成的“NOTE:无效参数”消息? data _null_; format test2 date9.; inp
我是一名优秀的程序员,十分优秀!