org.restlet.util.Series.getFirstValue()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(129)

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

Series.getFirstValue介绍

[英]Returns the value of the first parameter found with the given name.
[中]返回使用给定名称找到的第一个参数的值。

代码示例

代码示例来源: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 value of the first parameter found with the given name.
 * 
 * @param name
 *            The parameter name (case sensitive).
 * @return The value of the first parameter found with the given name.
 */
public String getFirstValue(String name) {
  return getFirstValue(name, false);
}

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

/**
 * Indicates if this URL is being examined in a context in which it makes
 * sense to allow user interactions such as popping up an authentication
 * dialog.
 * 
 * @return True if it makes sense to allow user interactions.
 */
public boolean isAllowUserInteraction() {
  return Boolean.parseBoolean(getHelpedParameters().getFirstValue(
      "allowUserInteraction", "false"));
}

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

/**
 * Indicates if the protocol will automatically follow redirects.
 * 
 * @return True if the protocol will automatically follow redirects.
 */
public boolean isFollowRedirects() {
  return Boolean.parseBoolean(getHelpedParameters().getFirstValue(
      "followRedirects", "false"));
}

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

/**
 * Returns the minimum threads waiting to service requests. Technically
 * speaking, this is a core number of threads that are pre-started.
 * 
 * @return The minimum threads waiting to service requests.
 */
public int getMinThreads() {
  return Integer.parseInt(getHelpedParameters().getFirstValue(
      "minThreads", "1"));
}

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

/**
 * Returns true if the request is a CORS request.
 * 
 * @param request
 *            The current request.
 * @return true if the request is a CORS request.
 */
public boolean isCorsRequest(Request request) {
  return request.getHeaders().getFirstValue("Origin", true) != null;
}

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

/**
 * Returns the maximum number of connections that will be created for any
 * particular host.
 * 
 * @return The maximum number of connections that will be created for any
 *         particular host.
 */
public int getMaxConnectionsPerHost() {
  return Integer.parseInt(getHelpedParameters().getFirstValue(
      "maxConnectionsPerHost", "10"));
}

代码示例来源:origin: com.noelios.restlet/com.noelios.restlet.ext.simple

/**
 * Returns the SSL keystore password.
 * 
 * @return The SSL keystore password.
 */
public String getKeystorePassword() {
  return getHelpedParameters().getFirstValue("keystorePassword", "");
}

代码示例来源:origin: com.noelios.restlet/com.noelios.restlet.ext.simple

/**
 * Returns the SSL keystore path.
 * 
 * @return The SSL keystore path.
 */
public String getKeystorePath() {
  return getHelpedParameters().getFirstValue("keystorePath",
      System.getProperty("user.home") + File.separator + ".keystore");
}

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

/**
 * Returns the SSL keystore type.
 * 
 * @return The SSL keystore type.
 */
public String getKeystoreType() {
  return getHelpedParameters().getFirstValue("keystoreType", "JKS");
}

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

/**
 * Returns the name of the RNG algorithm.
 * 
 * @return The name of the RNG algorithm.
 */
public String getSecureRandomAlgorithm() {
  return getHelpedParameters().getFirstValue("secureRandomAlgorithm",
      null);
}

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

/**
 * Indicates if we require client certificate authentication.
 * 
 * @return True if we require client certificate authentication.
 */
public boolean isNeedClientAuthentication() {
  return Boolean.parseBoolean(getHelpedParameters().getFirstValue(
      "needClientAuthentication", "false"));
}

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

/**
 * Returns the time in ms that connections will persist if listener is low
 * on resources.
 * 
 * @return The time in ms that connections will persist if listener is low
 *         on resources.
 */
public int getLowResourceMaxIdleTimeMs() {
  return Integer.parseInt(getHelpedParameters().getFirstValue(
      "lowResourceMaxIdleTimeMs", "2500"));
}

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

/**
 * Returns the threshold of remaining threads at which the server is
 * considered as running low on resources.
 * 
 * @return The threshold of remaining threads at which the server is
 *         considered as running low on resources.
 */
public int getLowThreads() {
  return Integer.parseInt(getHelpedParameters().getFirstValue(
      "lowThreads", "25"));
}

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

/**
 * Returns the minimum threads waiting to service requests.
 * 
 * @return The minimum threads waiting to service requests.
 */
public int getMinThreads() {
  return Integer.parseInt(getHelpedParameters().getFirstValue(
      "minThreads", "1"));
}

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

/**
 * Returns the read timeout value. A timeout of zero is interpreted as an
 * infinite timeout.
 * 
 * @return The read timeout value.
 */
public int getReadTimeout() {
  return Integer.parseInt(getHelpedParameters().getFirstValue(
      "readTimeout", "0"));
}

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

/**
 * Indicates if the protocol is allowed to use caching whenever it can.
 * 
 * @return True if the protocol is allowed to use caching whenever it can.
 */
public boolean isUseCaches() {
  return Boolean.parseBoolean(getHelpedParameters().getFirstValue(
      "useCaches", "false"));
}

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

/**
 * Indicates if the protocol is allowed to use caching whenever it can.
 * 
 * @return True if the protocol is allowed to use caching whenever it can.
 */
public boolean isUseCaches() {
  return Boolean.parseBoolean(getHelpedParameters().getFirstValue(
      "useCaches", "false"));
}

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

/**
 * Returns the SSL key password.
 * 
 * @return The SSL key password.
 */
@Deprecated
public String getKeyPassword() {
  return getHelpedParameters().getFirstValue("keyPassword",
      getKeystorePassword());
}

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

/**
 * Unget current authorization session.
 */
protected void ungetAuthSession() {
  String sessionId = getCookies().getFirstValue(ClientCookieID);
  // cleanup cookie.
  if (sessionId != null && sessionId.length() > 0) {
    ConcurrentMap<String, Object> attribs = getContext()
        .getAttributes();
    attribs.remove(sessionId);
  }
}

相关文章