本文整理了Java中org.restlet.util.Series.set()
方法的一些代码示例,展示了Series.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Series.set()
方法的具体详情如下:
包路径:org.restlet.util.Series
类名称:Series
方法名:set
[英]Replaces the value of the first parameter with the given name and removes all other parameters with the same name. The name matching is case sensitive.
[中]将第一个参数的值替换为给定名称,并删除具有相同名称的所有其他参数。名称匹配区分大小写。
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Replaces the value of the first parameter with the given name and removes
* all other parameters with the same name. The name matching is case
* sensitive.
*
* @param name
* The parameter name.
* @param value
* The value to set.
* @return The parameter set or added.
*/
public T set(String name, String value) {
return set(name, value, false);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Replaces the value of the first parameter with the given name and removes
* all other parameters with the same name. The name matching is case
* sensitive.
*
* @param name
* The parameter name.
* @param value
* The value to set.
* @return The parameter set or added.
*/
public T set(String name, String value) {
return set(name, value, false);
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.oauth
/**
* Sets the value of the "authPage" parameter.
*
* @param authPage
* The value of the "authPage" parameter.
* @param c
* The context to update.
*/
public static void setAuthPage(String authPage, Context c) {
c.getParameters().set("authPage", authPage);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Sets the value of the "filename" parameter.
*
* @param fileName
* The file name value.
*/
public void setFilename(String fileName) {
getParameters().set(Disposition.NAME_FILENAME, fileName, true);
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Sets the value of the "size" parameter.
*
* @param size
* The size.
*/
public void setSize(long size) {
getParameters().set(Disposition.NAME_SIZE, Long.toString(size), true);
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.oauth
/**
* Sets the value of the "loginPage" parameter.
*
* @param loginPage
* The value of the "loginPage" parameter.
* @param c
* The context to update.
*/
public static void setLoginPage(String loginPage, Context c) {
c.getParameters().set("loginPage", loginPage);
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.oauth
/**
* Sets the value of the "authPageTemplate" parameter.
*
* @param authPageTemplate
* The value of the "authPageTemplate" parameter.
* @param c
* The context to update.
*/
public static void setAuthPageTemplate(String authPageTemplate, Context c) {
c.getParameters().set("authPageTemplate", authPageTemplate);
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.oauth
/**
* Sets the value of the "authSkipApproved" parameter.
*
* @param skip
* The value of the "authSkipApproved" parameter.
* @param c
* The context to update.
*/
public static void setAuthSkipApproved(boolean skip, Context c) {
c.getParameters().set("authSkipApproved", Boolean.toString(skip));
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
public static void setSessionId(String sessionId) {
getResourceCookieSettings().set(ClientCookieID, sessionId);
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Sets the value of the "size" parameter.
*
* @param size
* The size.
*/
public void setSize(long size) {
getParameters().set(Disposition.NAME_SIZE, Long.toString(size), true);
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Sets the value of the "filename" parameter.
*
* @param fileName
* The file name value.
*/
public void setFilename(String fileName) {
getParameters().set(Disposition.NAME_FILENAME, fileName, true);
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.oauth
public static void setErrorPageTemplate(String errorPageTemplate, Context c) {
c.getParameters().set("errorPageTemplate", errorPageTemplate);
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Sets a Date parameter.
*
* @param name
* The name of the parameter.
* @param value
* Its value as a date.
*/
public void setDate(String name, Date value) {
getParameters().set(name,
DateUtils.format(value, DateUtils.FORMAT_RFC_822.get(0)), true);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Sets a Date parameter.
*
* @param name
* The name of the parameter.
* @param value
* Its value as a date.
*/
public void setDate(String name, Date value) {
getParameters().set(name,
DateUtils.format(value, DateUtils.FORMAT_RFC_822.get(0)), true);
}
代码示例来源:origin: org.restlet.gae/org.restlet.ext.platform
@Override
public int handle(Request request, Response response,
CounterResult counterResult) {
Series<Header> headers = response.getHeaders();
headers.set(
"X-RateLimit-Remaining",
Integer.toString(getLimit(request,
counterResult.getCountedValue())
- counterResult.getConsumed()));
headers.set(
"X-RateLimit-Limit",
Integer.toString(getLimit(request,
counterResult.getCountedValue())));
headers.set("X-RateLimit-Reset",
Long.toString(counterResult.getReset()));
response.getAttributes()
.put(HeaderConstants.ATTRIBUTE_HEADERS, headers);
return super.handle(request, response, counterResult);
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.platform
@Override
public int handle(Request request, Response response,
CounterResult counterResult) {
Series<Header> headers = response.getHeaders();
headers.set(
"X-RateLimit-Remaining",
Integer.toString(getLimit(request,
counterResult.getCountedValue())
- counterResult.getConsumed()));
headers.set(
"X-RateLimit-Limit",
Integer.toString(getLimit(request,
counterResult.getCountedValue())));
headers.set("X-RateLimit-Reset",
Long.toString(counterResult.getReset()));
response.getAttributes()
.put(HeaderConstants.ATTRIBUTE_HEADERS, headers);
return super.handle(request, response, counterResult);
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.platform
@Override
public int handle(Request request, Response response,
CounterResult counterResult) {
Series<Header> headers = response.getHeaders();
headers.set(
"X-RateLimit-Remaining",
Integer.toString(getLimit(request,
counterResult.getCountedValue())
- counterResult.getConsumed()));
headers.set(
"X-RateLimit-Limit",
Integer.toString(getLimit(request,
counterResult.getCountedValue())));
headers.set("X-RateLimit-Reset",
Long.toString(counterResult.getReset()));
response.getAttributes()
.put(HeaderConstants.ATTRIBUTE_HEADERS, headers);
return super.handle(request, response, counterResult);
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.apispark
@Override
public int handle(Request request, Response response,
CounterResult counterResult) {
Series<Header> headers = response.getHeaders();
headers.set(
"X-RateLimit-Remaining",
Integer.toString(getLimit(request,
counterResult.getCountedValue())
- counterResult.getConsumed()));
headers.set(
"X-RateLimit-Limit",
Integer.toString(getLimit(request,
counterResult.getCountedValue())));
headers.set("X-RateLimit-Reset",
Long.toString(counterResult.getReset()));
response.getAttributes()
.put(HeaderConstants.ATTRIBUTE_HEADERS, headers);
return super.handle(request, response, counterResult);
}
代码示例来源:origin: org.restlet.jse/org.restlet.example
/**
* Constructor.
*
* @throws Exception
*/
public MailServerComponent() throws Exception {
// Set basic properties
setName("RESTful Mail Server component");
setDescription("Example for 'Restlet in Action' book");
setOwner("Restlet S.A.S.");
setAuthor("The Restlet Team");
// Adds a HTTP server connector
Server server = getServers().add(Protocol.HTTP, 8111);
server.getContext().getParameters().set("tracing", "false");
// Attach the application to the default virtual host
getDefaultHost().attachDefault(new MailServerApplication());
}
}
代码示例来源:origin: org.umlg/runtime-restlet
/**
* default constructor for UmlgRestletComponent
*/
public UmlgRestletComponent() {
setName("restAndJson");
setDescription("Halo, I am your first comment.");
getClients().add(Protocol.FILE);
getClients().add(Protocol.CLAP);
getClients().add(Protocol.RIAP);
Server server = new Server(new Context(), Protocol.HTTP, 8111);
server.getContext().getParameters().set("tracing", "true");
getServers().add(server);
attachApplications();
}
内容来源于网络,如有侵权,请联系作者删除!