org.apache.http.cookie.Cookie.isSecure()方法的使用及代码示例

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

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

Cookie.isSecure介绍

[英]Indicates whether this cookie requires a secure connection.
[中]指示此cookie是否需要安全连接。

代码示例

代码示例来源:origin: robovm/robovm

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: apache/hive

/**
 * The function iterates through the list of cookies in the cookiestore and tries to
 * match them with the cookieName. If there is a match, the cookieStore already
 * has a valid cookie and the client need not send Credentials for validation purpose.
 * @param cookieStore The cookie Store
 * @param cookieName Name of the cookie which needs to be validated
 * @param isSSL Whether this is a http/https connection
 * @return true or false based on whether the client needs to send the credentials or
 * not to the server.
 */
static boolean needToSendCredentials(CookieStore cookieStore, String cookieName, boolean isSSL) {
 if (cookieName == null || cookieStore == null) {
  return true;
 }
 List<Cookie> cookies = cookieStore.getCookies();
 for (Cookie c : cookies) {
  // If this is a secured cookie and the current connection is non-secured,
  // then, skip this cookie. We need to skip this cookie because, the cookie
  // replay will not be transmitted to the server.
  if (c.isSecure() && !isSSL) {
   continue;
  }
  if (c.getName().equals(cookieName)) {
   return false;
  }
 }
 return true;
}

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

line.append(cookie.getPath() != null ? cookie.getPath() : "/");
line.append(tab);
line.append(cookie.isSecure() ? "TRUE" : "FALSE");
line.append(tab);
line.append(cookie.getExpiryDate() != null ? cookie.getExpiryDate().getTime() / 1000 : -1);

代码示例来源:origin: org.apache.knox/gateway-spi

@Override
public boolean isSecure() {
 return delegate.isSecure();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: MobiVM/robovm

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: com.gluonhq/robovm-rt

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: fhoeben/hsac-fitnesse-fixtures

/**
 * @param cookieName name of cookie.
 * @return whether cookie in the cookie store requires a secure connection.
 */
public Boolean cookieIsSecure(String cookieName) {
  Boolean result = null;
  Cookie cookie = getCookie(cookieName);
  if (cookie != null) {
    result = cookie.isSecure();
  }
  return result;
}

代码示例来源:origin: grzegorznittner/chanu

private void writeObject(ObjectOutputStream out) throws IOException {
  out.writeObject(cookie.getName());
  out.writeObject(cookie.getValue());
  out.writeObject(cookie.getComment());
  out.writeObject(cookie.getDomain());
  out.writeObject(cookie.getExpiryDate());
  out.writeObject(cookie.getPath());
  out.writeInt(cookie.getVersion());
  out.writeBoolean(cookie.isSecure());
}

代码示例来源:origin: yiwent/Mobike

private void writeObject(ObjectOutputStream out) throws IOException {
  out.writeObject(cookie.getName());
  out.writeObject(cookie.getValue());
  out.writeObject(cookie.getComment());
  out.writeObject(cookie.getDomain());
  out.writeObject(cookie.getExpiryDate());
  out.writeObject(cookie.getPath());
  out.writeInt(cookie.getVersion());
  out.writeBoolean(cookie.isSecure());
}

代码示例来源:origin: sealtalk/sealtalk-android

private void writeObject(ObjectOutputStream out) throws IOException {
  out.writeObject(cookie.getName());
  out.writeObject(cookie.getValue());
  out.writeObject(cookie.getComment());
  out.writeObject(cookie.getDomain());
  out.writeObject(cookie.getExpiryDate());
  out.writeObject(cookie.getPath());
  out.writeInt(cookie.getVersion());
  out.writeBoolean(cookie.isSecure());
}

代码示例来源:origin: ibinti/bugvm

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: com.hynnet/httpclient

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: org.apache.httpcomponents/httpclient-android

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: com.bugvm/bugvm-rt

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: Nextdoor/bender

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
  Args.notNull(cookie, "Cookie");
  Args.notNull(origin, "Cookie origin");
  return !cookie.isSecure() || origin.isSecure();
}

代码示例来源:origin: de.devbliss.apitester/apitester

Cookie(org.apache.http.cookie.Cookie cookie) {
  this.name = cookie.getName();
  this.value = cookie.getValue();
  this.expires = cookie.getExpiryDate();
  this.path = cookie.getPath();
  this.domain = cookie.getDomain();
  this.httpOnly = false;
  this.secure = cookie.isSecure();
}

代码示例来源:origin: com.machinepublishers/jbrowserdriver

private static Cookie convert(org.apache.http.cookie.Cookie in) {
 return new Cookie(in.getName(),
   in.getValue(),
   in.getDomain(),
   in.getPath(),
   in.getExpiryDate(),
   in.isSecure());
}

相关文章