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

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

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

Series.clear介绍

暂无

代码示例

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

/**
 * Sets the modifiable series of parameters.
 * 
 * @param parameters
 *            The modifiable series of parameters.
 */
public synchronized void setParameters(Series<Parameter> parameters) {
  this.parameters.clear();
  this.parameters.addAll(parameters);
}

代码示例来源:origin: org.nuxeo/nuxeo-http-client

protected void setupCookies(Request request) {
  if (cookies != null) {
    request.getCookies().clear();
    for (Cookie cookie : cookies) {
      request.getCookies().add(cookie);
    }
  }
}

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

/**
 * Sets the modifiable series of parameters. This method clears the current
 * series and adds all entries in the parameter series.
 * 
 * @param parameters
 *            A series of parameters.
 */
public void setParameters(Series<Parameter> parameters) {
  synchronized (getParameters()) {
    if (parameters != getParameters()) {
      getParameters().clear();
      if (parameters != null) {
        getParameters().addAll(parameters);
      }
    }
  }
}

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

/**
 * Sets the modifiable series of parameters. This method clears the current
 * series and adds all entries in the parameter series.
 * 
 * @param parameters
 *            A series of parameters.
 */
public void setParameters(Series<Parameter> parameters) {
  synchronized (getParameters()) {
    if (parameters != getParameters()) {
      getParameters().clear();
      if (parameters != null) {
        getParameters().addAll(parameters);
      }
    }
  }
}

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

/**
 * Constructor.
 * 
 * @param server
 *            The parent server.
 * @param byteBuffer
 *            The NIO byte buffer.
 * @param key
 *            The NIO selection key.
 * @param confidential
 *            Indicates if the call is confidential.
 */
public GrizzlyServerCall(Server server, ByteBuffer byteBuffer,
    SelectionKey key, boolean confidential) {
  super(server);
  setConfidential(confidential);
  this.byteBuffer = byteBuffer;
  this.requestStream = new InputReader();
  this.requestStream.setSelectionKey(key);
  this.requestStream.setByteBuffer(byteBuffer);
  this.socketChannel = (SocketChannel) key.channel();
  getRequestHeaders().clear();
  try {
    // Read the request header
    readRequestHead(this.requestStream);
  } catch (IOException ioe) {
    getLogger().log(Level.WARNING, "Unable to parse the HTTP request",
        ioe);
  }
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Sets the modifiable series of parameters. This method clears the current
 * series and adds all entries in the parameter series.
 * 
 * @param parameters
 *            A series of parameters.
 */
public void setParameters(Series<Parameter> parameters) {
  synchronized (getParameters()) {
    if (parameters != getParameters()) {
      getParameters().clear();
      if (parameters != null) {
        getParameters().addAll(parameters);
      }
    }
  }
}

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

/**
 * Sets the modifiable series of cookie settings provided by the server.
 * Note that when used with HTTP connectors, this property maps to the
 * "Set-Cookie" and "Set-Cookie2" headers. This method clears the current
 * series and adds all entries in the parameter series.
 * 
 * @param cookieSettings
 *            A series of cookie settings provided by the server.
 */
public void setCookieSettings(Series<CookieSetting> cookieSettings) {
  synchronized (getCookieSettings()) {
    if (cookieSettings != getCookieSettings()) {
      getCookieSettings().clear();
      if (cookieSettings != null) {
        getCookieSettings().addAll(cookieSettings);
      }
    }
  }
}

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

/**
 * Sets the modifiable series of cookies provided by the client. Note that
 * when used with HTTP connectors, this property maps to the "Cookie"
 * header. This method clears the current series and adds all entries in the
 * parameter series.
 * 
 * @param cookies
 *            A series of cookies provided by the client.
 */
public void setCookies(Series<Cookie> cookies) {
  synchronized (getCookies()) {
    if (cookies != getCookies()) {
      if (getCookies() != null) {
        getCookies().clear();
      }
      if (cookies != null) {
        getCookies().addAll(cookies);
      }
    }
  }
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Sets the modifiable series of cookies provided by the client. Note that
 * when used with HTTP connectors, this property maps to the "Cookie"
 * header. This method clears the current series and adds all entries in the
 * parameter series.
 * 
 * @param cookies
 *            A series of cookies provided by the client.
 */
public void setCookies(Series<Cookie> cookies) {
  synchronized (getCookies()) {
    if (cookies != getCookies()) {
      if (getCookies() != null) {
        getCookies().clear();
      }
      if (cookies != null) {
        getCookies().addAll(cookies);
      }
    }
  }
}

相关文章