本文整理了Java中org.restlet.Response.<init>
方法的一些代码示例,展示了Response.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.<init>
方法的具体详情如下:
包路径:org.restlet.Response
类名称:Response
方法名:<init>
[英]Constructor.
[中]建造师。
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Constructor.
*
* @param request
* The handled request.
*/
public ClientResource(Request request) {
this(request, new Response(request));
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Creates a new response for the given request.
*
* @param request
* The associated request.
* @return The new response.
*/
protected Response createResponse(Request request) {
return new Response(request);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Handles a call.
*
* @param request
* The request to handle.
* @param onReceivedCallback
* The callback invoked upon request reception.
*/
public final void handle(Request request, Uniform onReceivedCallback) {
Response response = new Response(request);
handle(request, response, onReceivedCallback);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Handles a call. Creates an empty {@link Response} object and then invokes
* {@link #handle(Request, Response)}.
*
* @param request
* The request to handle.
* @return The returned response.
*/
public final Response handle(Request request) {
Response response = new Response(request);
handle(request, response);
return response;
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Constructor.
*
* @param context
* The context.
* @param method
* The method to call.
* @param reference
* The target reference.
*/
public ClientResource(Context context, Method method, Reference reference) {
this(context, new Request(method, reference), new Response(null));
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
Response response = new Response(request);
AuthPageServerResource.init(request, response);
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
request.setClientInfo(clientInfo);
Response response = new Response(request);
AccessTokenServerResource.init(request, response);
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public Representation put(Representation entity) throws ResourceException {
if (!this.directory.isModifiable()) {
setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED, "The directory is not modifiable.");
return null;
}
// Transfer of PUT calls is only allowed if the readOnly flag is not set.
Request contextRequest = new Request(Method.PUT, this.targetUri);
// Add support of partial PUT calls.
contextRequest.getRanges().addAll(getRanges());
contextRequest.setEntity(entity);
Response contextResponse = new Response(contextRequest);
contextRequest.setResourceRef(this.targetUri);
getClientDispatcher().handle(contextRequest, contextResponse);
setStatus(contextResponse.getStatus());
return null;
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
request.setOriginalRef(requestReference);
request.setResourceRef(requestReference);
Response response = new Response(request);
LoginPageServerResource.init(request, response);
ResultRepresentation resultRepresentation;
代码示例来源:origin: org.restlet.jse/org.restlet.example
/**
* Unit test for virtual hosts.
*
* @throws Exception
*/
public void testVirtualHost() throws Exception {
// Instantiate our Restlet component
MailServerComponent component = new MailServerComponent();
// Prepare a mock HTTP call
Request request = new Request();
request.setMethod(Method.GET);
request.setResourceRef("http://www.rmep.org/accounts/");
request.setHostRef("http://www.rmep.org");
Response response = new Response(request);
response.getServerInfo().setAddress("1.2.3.10");
response.getServerInfo().setPort(80);
component.handle(request, response);
// Test if response was successful
assertTrue(response.getStatus().isSuccess());
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Constructor.
*
* @param resource
* The client resource to copy.
*/
public ClientResource(ClientResource resource) {
Request request = new Request(resource.getRequest());
Response response = new Response(request);
this.next = resource.getNext();
this.maxRedirects = resource.getMaxRedirects();
this.retryOnError = resource.isRetryOnError();
this.retryDelay = resource.getRetryDelay();
this.retryAttempts = resource.getRetryAttempts();
this.followingRedirects = resource.isFollowingRedirects();
this.requestEntityBuffering = resource.isRequestEntityBuffering();
this.responseEntityBuffering = resource.isResponseEntityBuffering();
setApplication(resource.getApplication());
init(resource.getContext(), request, response);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
Response contextResponse = new Response(contextRequest);
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
Response response = new Response(request);
request.setResourceRef(new Reference(DUMMY_REFERENCE));
代码示例来源:origin: apache/attic-polygene-java
while( true )
Response response = new Response( request );
try
代码示例来源:origin: apache/attic-polygene-java
request.setChallengeResponse( new ChallengeResponse( ChallengeScheme.HTTP_BASIC, user.getName(), user.getSecret() ) );
Response response = new Response( request );
代码示例来源:origin: apache/attic-polygene-java
request.setChallengeResponse( new ChallengeResponse( ChallengeScheme.HTTP_BASIC, user.getName(), user.getSecret() ) );
Response response = new Response( request );
contextResourceFactory.getClient().handle( request, response );
代码示例来源:origin: com.github.ansell.restlet-utils/restlet-utils
final Response response = new Response(request);
内容来源于网络,如有侵权,请联系作者删除!