本文整理了Java中org.glassfish.grizzly.http.util.Header.equals()
方法的一些代码示例,展示了Header.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.equals()
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.util.Header
类名称:Header
方法名:equals
暂无
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: javaee/grizzly
private String getValueBasedOnHeader(final Header header) {
if (Header.ContentType.equals(header)) {
final String value = getContentType();
if (value != null) {
return value;
}
} else if (Header.ContentLength.equals(header)) {
final long value = getContentLength();
if (value >= 0) {
return Long.toString(value);
}
} else if (Header.Upgrade.equals(header)) {
return getUpgrade();
}
return null;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
代码示例来源:origin: javaee/grizzly
/**
* Set internal fields for special header names.
* Called from set/addHeader.
* Return true if the header is special, no need to set the header.
*/
private boolean setValueBasedOnHeader(final Header header, final String value) {
if (Header.ContentType.equals(header)) {
setContentType(value);
return true;
} else if (Header.ContentLength.equals(header)) {
headers.removeHeader(Header.TransferEncoding);
setChunked(false);
return setContentLenth(value);
} else if (Header.Upgrade.equals(header)) {
setUpgrade(value);
} else if (Header.TransferEncoding.equals(header)) {
if ("chunked".equalsIgnoreCase(value)) {
setContentLengthLong(-1);
setChunked(true);
}
return true;
}
//if (name.equalsIgnoreCase("Content-Language")) {
// // TODO XXX XXX Need to construct Locale or something else
//}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!