org.restlet.data.Request.getCookies()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(218)

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

Request.getCookies介绍

[英]Returns the modifiable series of cookies provided by the client. Creates a new instance if no one has been set.
[中]返回客户端提供的可修改cookie系列。如果未设置任何实例,则创建新实例。

代码示例

代码示例来源:origin: internetarchive/heritrix3

public static List<Flash> getFlashes(Request request) {
  List<Flash> flashes = new LinkedList<Flash>();
  Series<Cookie> cookies = request.getCookies();
  String flashdrops = cookies.getFirstValue("flashdrop");
  if (StringUtils.isBlank(flashdrops)) {
    return flashes;
  }
  for (String dropbox : flashdrops.split(",")) {
    if(dropbox!=null) {
      Flash flash = dropboxes.remove(Long.parseLong(dropbox));
      if(flash!=null) {
        flashes.add(flash); 
      }
    }
  }
  return flashes;
}

代码示例来源:origin: org.restlet/org.restlet

/**
 * Returns the cookies provided by the client.
 * 
 * @return The cookies provided by the client.
 */
@Override
public Series<Cookie> getCookies() {
  return getWrappedRequest().getCookies();
}

代码示例来源:origin: org.archive.heritrix/heritrix-engine

public static List<Flash> getFlashes(Request request) {
  List<Flash> flashes = new LinkedList<Flash>();
  Series<Cookie> cookies = request.getCookies();
  String flashdrops = cookies.getFirstValue("flashdrop");
  if (StringUtils.isBlank(flashdrops)) {
    return flashes;
  }
  for (String dropbox : flashdrops.split(",")) {
    if(dropbox!=null) {
      Flash flash = dropboxes.remove(Long.parseLong(dropbox));
      if(flash!=null) {
        flashes.add(flash); 
      }
    }
  }
  return flashes;
}

代码示例来源:origin: org.restlet/org.restlet

final Series<Cookie> cookies = request.getCookies();

相关文章