- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.jcabi.http.response.XmlResponse.xml()
方法的一些代码示例,展示了XmlResponse.xml()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlResponse.xml()
方法的具体详情如下:
包路径:com.jcabi.http.response.XmlResponse
类名称:XmlResponse
方法名:xml
[英]Get XML body.
[中]获取XML正文。
代码示例来源:origin: yegor256/netbout
@Override
public Locale locale() throws IOException {
return new Locale(
this.request.fetch()
.as(XmlResponse.class)
.xml()
.xpath("/page/alias/locale/text()")
.get(0)
);
}
代码示例来源:origin: yegor256/netbout
@Override
public URI photo() throws IOException {
return URI.create(
this.request.fetch()
.as(XmlResponse.class)
.xml()
.xpath("/page/alias/photo/text()")
.get(0)
);
}
代码示例来源:origin: yegor256/netbout
@Override
public String name() throws IOException {
return this.request.fetch()
.as(XmlResponse.class)
.xml()
.xpath("/page/alias/name/text()")
.get(0);
}
代码示例来源:origin: yegor256/netbout
@Override
public String email() throws IOException {
return this.request.fetch()
.as(XmlResponse.class)
.xml()
.xpath("/page/alias/email/text()")
.get(0);
}
代码示例来源:origin: jcabi/jcabi-http
/**
* Follow XML link.
* @param query XPath query to fetch new URI
* @return New request
*/
public Request rel(final String query) {
this.assertXPath(query);
return new RestResponse(this).jump(
URI.create(this.xml().xpath(query).get(0))
);
}
代码示例来源:origin: yegor256/netbout
@Override
public boolean subscription() throws IOException {
return Boolean.valueOf(
this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath("/page/bout/subscription/text()")
.get(0)
);
}
代码示例来源:origin: yegor256/netbout
@Override
public boolean unseen() throws IOException {
return Boolean.parseBoolean(
this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath(this.xpath("unseen/text()"))
.get(0)
);
}
代码示例来源:origin: yegor256/netbout
@Override
public Date date() throws IOException {
return new Date(
Long.parseLong(
this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath(this.xpath("date/text()"))
.get(0)
)
);
}
代码示例来源:origin: yegor256/netbout
@Override
public String title() throws IOException {
return this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath("/page/bout/title/text()")
.get(0);
}
代码示例来源:origin: yegor256/netbout
@Override
public Date date() throws IOException {
try {
return DateFormatUtils.ISO_DATETIME_FORMAT.parse(
this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath("/page/bout/date/text()")
.get(0)
);
} catch (final ParseException ex) {
throw new IllegalStateException(ex);
}
}
代码示例来源:origin: yegor256/netbout
@Override
public String author() throws IOException {
return this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath(this.xpath("author/text()"))
.get(0);
}
代码示例来源:origin: yegor256/netbout
@Override
public String etag() throws IOException {
return this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath(this.xpath("etag/text()"))
.get(0);
}
代码示例来源:origin: yegor256/netbout
@Override
public String ctype() throws IOException {
return this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath(this.xpath("ctype/text()"))
.get(0);
}
代码示例来源:origin: yegor256/netbout
@Override
public Iterable<Attachment> iterate() throws IOException {
return Iterables.transform(
this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath("/page/bout/attachments/attachment/name/text()"),
new Function<String, Attachment>() {
@Override
public Attachment apply(final String name) {
return RtAttachments.this.get(name);
}
}
);
}
}
代码示例来源:origin: co.stateful/java-sdk
@Override
public Iterable<String> names() throws IOException {
return this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath("/page/counters/counter/name/text()");
}
代码示例来源:origin: co.stateful/java-sdk
@Override
public boolean exists(final String name) throws IOException {
return !this.request
.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.rel("/page/links/link[@rel='self']/@href")
.method(Request.GET)
.fetch()
.as(XmlResponse.class)
.xml()
.nodes(String.format("/page/locks/lock[name='%s']", name))
.isEmpty();
}
代码示例来源:origin: com.jcabi/jcabi-w3c
@Override
public ValidationResponse validate(final String html)
throws IOException {
final Request req = this.request(html);
final Response response = req.fetch();
if (response.status() != HttpURLConnection.HTTP_OK) {
throw new IOException(
response.reason()
);
}
return this.build(
response.as(XmlResponse.class)
.registerNs("nu", "http://n.validator.nu/messages/")
.assertXPath("//nu:messages")
.assertXPath("//nu:source")
.xml()
);
}
代码示例来源:origin: yegor256/netbout
@Override
public long start() throws IOException {
final long number = Long.parseLong(
this.request.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.rel("/page/links/link[@rel='start']/@href")
.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_SEE_OTHER)
.follow()
.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.xml()
.xpath("/page/bout/number/text()")
.get(0)
);
Logger.info(this, "bout #%d started", number);
return number;
}
代码示例来源:origin: com.jcabi/jcabi-w3c
/**
* Return a response after real processing of the CSS.
* @param css The CSS stylesheet to check
* @return The response
* @throws IOException if fails
*/
private ValidationResponse processed(final String css) throws IOException {
final Request req = this.request(
AbstractBaseValidator.entity(
"file", DefaultCssValidator.filter(css), "text/css"
)
);
final Response response = DefaultCssValidator.correct(req.fetch());
return DefaultCssValidator.build(
response.as(XmlResponse.class)
.registerNs("env", "http://www.w3.org/2003/05/soap-envelope")
.registerNs("m", "http://www.w3.org/2005/07/css-validator")
.assertXPath("//m:validity")
.assertXPath("//m:checkedby")
.xml()
);
}
代码示例来源:origin: yegor256/takes
/**
* Retrieve Github access token.
* @param home Home of this page
* @param code Github "authorization code"
* @return The token
* @throws IOException If failed
*/
private String token(final String home, final String code)
throws IOException {
final String uri = new Href(this.github)
.path(PsGithub.LOGIN).path("oauth").path(PsGithub.ACCESS_TOKEN)
.toString();
return new JdkRequest(uri)
.method("POST")
.header("Accept", "application/xml")
.body()
.formParam("client_id", this.app)
.formParam("redirect_uri", home)
.formParam("client_secret", this.key)
.formParam(PsGithub.CODE, code)
.back()
.fetch().as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.assertXPath("/OAuth/access_token")
.xml()
.xpath("/OAuth/access_token/text()")
.get(0);
}
我正在尝试按照 http://www.yegor256.com/2014/05/23/avoid-java-static-logger.html 的链接中所述使用 jcabi-log 进行记录. 我有
jcabi @RetryOnFailure 无法解析为类型。 我在我的 pom.xml 中添加了'编织'和 jcabi 依赖项 com.jcabi jcabi-mave
我目前正在开发 Bukkit 插件,并尝试实现从 github 获取配置文件。我正在尝试使用 JCabi-Github 来实现此目的。我实现了该库并正常工作,但每当我使用它时,它都会产生错误。我尝试使
本文整理了Java中com.jcabi.http.response.XmlResponse类的一些代码示例,展示了XmlResponse类的具体用法。这些代码示例主要来源于Github/Stackov
我正在注释我的函数 @Loggable jcabi 注释。它记录的语句不完整,它修剪行并只打印 .. 截断的数据。我想要打印整行。可以用这个注释来完成吗? @Loggable(Loggable.DEB
我正在尝试使用 jcabi 进行日志记录。据我了解,从 jcabi pom 文件继承我的 pom 进行设置会更容易,如 http://www.jcabi.com/parent/index.html 中
我正在尝试使用 jcabi-xml 将参数传递给 XSL 文件。代码很简单,我可以确认它执行: final XSL xsl = new XSLDocument(Main.class.getResour
我正在编写一个小应用程序,通过 SSH 连接到服务器列表并执行一些命令。我正在使用jcabi-ssh 。当我运行该程序时,jcabi-ssh 会向控制台输出如下行: [main] WARN com.j
我正在使用 NetBeans 编写一个 java 应用程序,它允许我获取 GitHub 用户存储库的 zip 文件。为此,我导入了一个外部 jar 库,jcabi library ,进入让我与 Git
本文整理了Java中com.jcabi.http.response.XmlResponse.()方法的一些代码示例,展示了XmlResponse.()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中com.jcabi.http.response.XmlResponse.assertXPath()方法的一些代码示例,展示了XmlResponse.assertXPath()的具体
本文整理了Java中com.jcabi.http.response.XmlResponse.rel()方法的一些代码示例,展示了XmlResponse.rel()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中com.jcabi.http.response.XmlResponse.xml()方法的一些代码示例,展示了XmlResponse.xml()的具体用法。这些代码示例主要来源于Gi
每当我尝试从命令提示符运行项目的 jar 文件时,我都会收到此错误。这是什么意思?我检查了 ValidatorBuilder 的 list ,它具有 jcabi-version 属性。任何帮助表示赞赏
当我使用 jcabi ssh 库执行 shell 命令时,当我执行以下操作时,我将如何或需要关闭 session ?当我在循环场景中配对时,我怀疑我的套接字用完了。 `Shell shell = ne
我厌倦了手动添加日志来调试我编写的每个方法。 我开始了解 jcabi 的 @Loggable 注释但我没有成功实现,非常感谢您的帮助。 下面是我试过的代码。 import com.jcabi.aspe
我正在使用 com.jcabi.aspects 的 @Cacheable 注释作为我项目中的缓存机制,我有一个场景需要从中刷新特定数据缓存而不是刷新整个缓存。怎么可能? 例如, import com.
我正在尝试使用 Maven 和 Jcabi-Aether 获取/解决一些 Artifact 。我想我已经准备好了大部分代码,但我很难弄清楚如何加载用户的 settings.xml 以便我可以将 Mav
我需要执行以下命令: scp -r ~/dataIn yatsuk@192.168.1.1:~/dataOut 在 Ubuntu (16.04) 终端中,此命令可以正常工作。yatsuk@192.16
我是一名优秀的程序员,十分优秀!