org.apache.abdera.model.Document.getSlug()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.apache.abdera.model.Document.getSlug()方法的一些代码示例,展示了Document.getSlug()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.getSlug()方法的具体详情如下:
包路径:org.apache.abdera.model.Document
类名称:Document
方法名:getSlug

Document.getSlug介绍

[英]Get the slug for this document
[中]

代码示例

代码示例来源:origin: org.apache.abdera/abdera-client

/**
 * Sends an HTTP POST request to the specified URI.
 * 
 * @param uri The request URI
 * @param base An Abdera FOM Document or Element object providing the payload of the request
 * @param options The request options
 */
public ClientResponse post(String uri, Base base, RequestOptions options) {
  if (base instanceof Document) {
    Document d = (Document)base;
    if (options.getSlug() == null && d.getSlug() != null)
      options.setSlug(d.getSlug());
  }
  return execute("POST", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
}

代码示例来源:origin: org.apache.abdera/abdera-client

/**
 * Sends an HTTP PUT request to the specified URI.
 * 
 * @param uri The request URI
 * @param base A FOM Document or Element providing the payload of the request
 * @param options The request options
 */
public ClientResponse put(String uri, Base base, RequestOptions options) {
  if (options == null)
    options = getDefaultRequestOptions();
  if (base instanceof Document) {
    Document d = (Document)base;
    if (options.getSlug() == null && d.getSlug() != null)
      options.setSlug(d.getSlug());
    if (options.isConditionalPut()) {
      if (d.getEntityTag() != null)
        options.setIfMatch(d.getEntityTag());
      else if (d.getLastModified() != null)
        options.setIfUnmodifiedSince(d.getLastModified());
    }
  }
  return execute("PUT", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
}

代码示例来源:origin: org.apache.abdera/abdera-extensions-json

private static void toJson(Document document, JSONStream jstream) throws IOException {
  jstream.startObject();
  jstream.writeField("base", document.getBaseUri());
  jstream.writeField("content-type", document.getContentType());
  jstream.writeField("etag", document.getEntityTag());
  jstream.writeField("language", document.getLanguage());
  jstream.writeField("slug", document.getSlug());
  jstream.writeField("last-modified", document.getLastModified());
  Element root = document.getRoot();
  if (root != null) {
    String rootname = root.getQName().getLocalPart();
    writeElement(rootname, document.getRoot(), jstream);
  }
  jstream.endObject();
}

相关文章