本文整理了Java中org.restlet.data.Protocol.getName()
方法的一些代码示例,展示了Protocol.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.getName()
方法的具体详情如下:
包路径:org.restlet.data.Protocol
类名称:Protocol
方法名:getName
[英]Returns the name.
[中]返回名称。
代码示例来源:origin: org.restlet.osgi/org.restlet
/** {@inheritDoc} */
@Override
public boolean equals(final Object object) {
return (object instanceof Protocol)
&& getName().equalsIgnoreCase(((Protocol) object).getName());
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/** {@inheritDoc} */
@Override
public boolean equals(final Object object) {
return (object instanceof Protocol)
&& getName().equalsIgnoreCase(((Protocol) object).getName());
}
代码示例来源:origin: org.restlet/org.restlet
/** {@inheritDoc} */
@Override
public boolean equals(final Object object) {
return (object instanceof Protocol)
&& getName().equalsIgnoreCase(((Protocol) object).getName());
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/** {@inheritDoc} */
@Override
public int hashCode() {
return (getName() == null) ? 0 : getName().toLowerCase().hashCode();
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/** {@inheritDoc} */
@Override
public int hashCode() {
return (getName() == null) ? 0 : getName().toLowerCase().hashCode();
}
代码示例来源:origin: org.restlet/org.restlet
/** {@inheritDoc} */
@Override
public int hashCode() {
return (getName() == null) ? 0 : getName().toLowerCase().hashCode();
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Returns the name.
*
* @return The name.
*/
@Override
public String toString() {
return getName() + ((getVersion() == null) ? "" : "/" + getVersion());
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Returns the name.
*
* @return The name.
*/
@Override
public String toString() {
return getName() + ((getVersion() == null) ? "" : "/" + getVersion());
}
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public void handle(Request request, Response response) {
super.handle(request, response);
if (getHelper() != null) {
getHelper().handle(request, response);
} else {
StringBuilder sb = new StringBuilder();
sb.append("No available client connector supports the required protocol: ");
sb.append("'").append(request.getProtocol().getName()).append("'.");
sb.append(" Please add the JAR of a matching connector to your classpath.");
response.setStatus(Status.CONNECTOR_ERROR_INTERNAL, sb.toString());
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
sb.append("'").append(p.getName()).append("' ");
代码示例来源:origin: org.restlet.osgi/org.restlet
sb.append("'").append(p.getName()).append("' ");
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public void handle(Request request, Response response) {
Protocol rProtocol = request.getProtocol();
Reference rReference = request.getResourceRef();
Protocol protocol = (rProtocol != null) ? rProtocol
: (rReference != null) ? rReference
.getSchemeProtocol() : null;
if (protocol != null) {
Client c = clients.get(protocol);
if (c == null) {
c = new Client(protocol);
clients.put(protocol, c);
getLogger().fine(
"Added runtime client for protocol: "
+ protocol.getName());
}
c.handle(request, response);
} else {
response.setStatus(Status.SERVER_ERROR_INTERNAL,
"The server isn't properly configured to handle client calls.");
getLogger().warning(
"There is no protocol detected for this request: "
+ request.getResourceRef());
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Creates the protocol associated to a URI scheme name. If an existing
* constant exists then it is returned, otherwise a new instance is created.
*
* @param name
* The scheme name.
* @param version
* The version number.
* @return The associated protocol.
*/
public static Protocol valueOf(String name, String version) {
Protocol result = valueOf(name);
if (!version.equals(result.getVersion())) {
result = new Protocol(result.getSchemeName(), result.getName(),
result.getTechnicalName(), result.getDescription(),
result.getDefaultPort(), result.isConfidential(), version);
}
return result;
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Creates the protocol associated to a URI scheme name. If an existing
* constant exists then it is returned, otherwise a new instance is created.
*
* @param name
* The scheme name.
* @param version
* The version number.
* @return The associated protocol.
*/
public static Protocol valueOf(String name, String version) {
Protocol result = valueOf(name);
if (!version.equals(result.getVersion())) {
result = new Protocol(result.getSchemeName(), result.getName(),
result.getTechnicalName(), result.getDescription(),
result.getDefaultPort(), result.isConfidential(), version);
}
return result;
}
代码示例来源:origin: org.restlet.osgi/org.restlet
+ application.getName()
+ "\". Client connector for protocol "
+ clientProtocol.getName()
+ " is missing.");
result = false;
+ application.getName()
+ "\". Server connector for protocol "
+ serverProtocol.getName()
+ " is missing.");
result = false;
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public RecipientInfoWriter append(RecipientInfo recipientInfo) {
if (recipientInfo.getProtocol() != null) {
appendToken(recipientInfo.getProtocol().getName());
append('/');
appendToken(recipientInfo.getProtocol().getVersion());
appendSpace();
if (recipientInfo.getName() != null) {
append(recipientInfo.getName());
if (recipientInfo.getComment() != null) {
appendSpace();
appendComment(recipientInfo.getComment());
}
} else {
throw new IllegalArgumentException(
"The name (host or pseudonym) of a recipient can't be null");
}
} else {
throw new IllegalArgumentException(
"The protocol of a recipient can't be null");
}
return this;
}
代码示例来源:origin: org.restlet/org.restlet
} else if (variableName.equals("p")) {
if (this.request.getProtocol() != null) {
result = this.request.getProtocol().getName();
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Displays a synthesis of the request like an HTTP request line.
*
* @return A synthesis of the request like an HTTP request line.
*/
public String toString() {
return ((getMethod() == null) ? "" : getMethod().toString())
+ " "
+ ((getResourceRef() == null) ? "" : getResourceRef()
.toString())
+ " "
+ ((getProtocol() == null) ? ""
: (getProtocol().getName() + ((getProtocol()
.getVersion() == null) ? "" : "/"
+ getProtocol().getVersion())));
}
代码示例来源:origin: org.restlet.osgi/org.restlet
return (this.request.getMethod() != null) ? this.request.getMethod().getName() : null;
case "p":
return (this.request.getProtocol() != null) ? this.request.getProtocol().getName() : null;
default:
if (variableName.startsWith("o")) {
内容来源于网络,如有侵权,请联系作者删除!