org.glassfish.grizzly.http.server.Response.addDateHeader()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(82)

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

Response.addDateHeader介绍

[英]Add the specified date header to the specified value.
[中]将指定的日期标题添加到指定的值。

代码示例

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void addDateHeader(String name, long date) {
  if (isCommitted())
    return;
  response.addDateHeader(name, date);
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: javaee/grizzly

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: javaee/grizzly

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void addDateHeader(String name, long date) {
  if (isCommitted())
    return;
  response.addDateHeader(name, date);
}

代码示例来源:origin: javaee/grizzly

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: javaee/grizzly

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void addDateHeader(String name, long date) {
  if (isCommitted())
    return;
  response.addDateHeader(name, date);
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void addDateHeader(String name, long date) {
  if (isCommitted())
    return;
  response.addDateHeader(name, date);
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void addDateHeader(String name, long date) {
  if (isCommitted())
    return;
  response.addDateHeader(name, date);
}

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

protected static void addCachingHeaders(final Response response,
                   final File file) {
  final StringBuilder sb = new StringBuilder();
  final long fileLength = file.length();
  final long lastModified = file.lastModified();
  if ((fileLength >= 0) || (lastModified >= 0)) {
    sb.append('"').append(fileLength).append('-').
        append(lastModified).append('"');
    response.setHeader(Header.ETag, sb.toString());
  }
  response.addDateHeader(Header.LastModified, lastModified);
}

代码示例来源:origin: javaee/grizzly

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: javaee/grizzly

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: javaee/grizzly

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: javaee/grizzly

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: javaee/grizzly

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

private static void sendResource(final Response response,
    final InputStream input) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.addDateHeader(Header.Date, System.currentTimeMillis());
  final int chunkSize = 8192;
  
  response.suspend();
  
  final NIOOutputStream outputStream = response.getNIOOutputStream();
  
  outputStream.notifyCanWrite(
      new NonBlockingDownloadHandler(response, outputStream,
          input, chunkSize));
}

相关文章

微信公众号

最新文章

更多

Response类方法