本文整理了Java中org.glassfish.grizzly.http.server.Response.addDateHeader
方法的一些代码示例,展示了Response.addDateHeader
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.addDateHeader
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Response
类名称: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));
}
内容来源于网络,如有侵权,请联系作者删除!