Tabnine Logo
Response.setLocationRef
Code IndexAdd Tabnine to your IDE (free)

How to use
setLocationRef
method
in
org.restlet.Response

Best Java code snippets using org.restlet.Response.setLocationRef (Showing top 20 results out of 315)

origin: org.restlet.osgi/org.restlet

/**
 * Permanently redirects the client to a target URI. The client is expected
 * to reuse the same method for the new request.
 * 
 * @param targetRef
 *            The target URI reference.
 */
public void redirectPermanent(Reference targetRef) {
  setLocationRef(targetRef);
  setStatus(Status.REDIRECTION_PERMANENT);
}
origin: org.restlet.osgi/org.restlet

/**
 * Temporarily redirects the client to a target URI. The client is expected
 * to reuse the same method for the new request.
 * 
 * @param targetRef
 *            The target reference.
 */
public void redirectTemporary(Reference targetRef) {
  setLocationRef(targetRef);
  setStatus(Status.REDIRECTION_TEMPORARY);
}
origin: org.restlet.osgi/org.restlet

/**
 * Sets the reference that the client should follow for redirections or
 * resource creations.
 * 
 * @param locationRef
 *            The reference to set.
 */
@Override
public void setLocationRef(Reference locationRef) {
  getWrappedResponse().setLocationRef(locationRef);
}
origin: org.restlet.osgi/org.restlet

/**
 * Sets the reference that the client should follow for redirections or
 * resource creations.
 * 
 * @param locationUri
 *            The URI to set.
 */
@Override
public void setLocationRef(String locationUri) {
  getWrappedResponse().setLocationRef(locationUri);
}
origin: org.restlet.osgi/org.restlet

/**
 * Permanently redirects the client to a target URI. The client is expected
 * to reuse the same method for the new request.<br>
 * <br>
 * If you pass a relative target URI, it will be resolved with the current
 * base reference of the request's resource reference (see {@link Request#getResourceRef()} and
 * {@link Reference#getBaseRef()}.
 * 
 * @param targetUri
 *            The target URI.
 */
public void redirectPermanent(String targetUri) {
  setLocationRef(targetUri);
  setStatus(Status.REDIRECTION_PERMANENT);
}
origin: org.restlet.osgi/org.restlet

/**
 * Redirects the client to a different URI that SHOULD be retrieved using a
 * GET method on that resource. This method exists primarily to allow the
 * output of a POST-activated script to redirect the user agent to a
 * selected resource. The new URI is not a substitute reference for the
 * originally requested resource.
 * 
 * @param targetRef
 *            The target reference.
 */
public void redirectSeeOther(Reference targetRef) {
  setLocationRef(targetRef);
  setStatus(Status.REDIRECTION_SEE_OTHER);
}
origin: org.restlet.osgi/org.restlet

/**
 * Temporarily redirects the client to a target URI. The client is expected
 * to reuse the same method for the new request.<br>
 * <br>
 * If you pass a relative target URI, it will be resolved with the current
 * base reference of the request's resource reference (see {@link Request#getResourceRef()} and
 * {@link Reference#getBaseRef()}.
 * 
 * @param targetUri
 *            The target URI.
 */
public void redirectTemporary(String targetUri) {
  setLocationRef(targetUri);
  setStatus(Status.REDIRECTION_TEMPORARY);
}
origin: org.restlet.osgi/org.restlet

/**
 * Redirects the client to a different URI that SHOULD be retrieved using a
 * GET method on that resource. This method exists primarily to allow the
 * output of a POST-activated script to redirect the user agent to a
 * selected resource. The new URI is not a substitute reference for the
 * originally requested resource.<br>
 * <br>
 * If you pass a relative target URI, it will be resolved with the current
 * base reference of the request's resource reference (see {@link Request#getResourceRef()} and
 * {@link Reference#getBaseRef()}.
 * 
 * @param targetUri
 *            The target URI.
 */
public void redirectSeeOther(String targetUri) {
  setLocationRef(targetUri);
  setStatus(Status.REDIRECTION_SEE_OTHER);
}
origin: org.restlet.osgi/org.restlet

/**
 * Sets the reference that the client should follow for redirections or
 * resource creations.
 * 
 * @param locationRef
 *            The reference to set.
 * @see Response#setLocationRef(Reference)
 */
public void setLocationRef(Reference locationRef) {
  if (getResponse() != null) {
    getResponse().setLocationRef(locationRef);
  }
}
origin: org.restlet.osgi/org.restlet

/**
 * Sets the reference that the client should follow for redirections or
 * resource creations. If you pass a relative location URI, it will be
 * resolved with the current base reference of the request's resource
 * reference (see {@link Request#getResourceRef()} and {@link Reference#getBaseRef()}.
 * 
 * @param locationUri
 *            The URI to set.
 * @see Response#setLocationRef(String)
 */
public void setLocationRef(String locationUri) {
  if (getResponse() != null) {
    getResponse().setLocationRef(locationUri);
  }
}
origin: apache/attic-polygene-java

private void post( final Request request, final Response response )
{
  execute( request, response, resource -> {
    RestForm form = createRestForm( request );
    RestLink link = resource.post( form );
    response.setLocationRef( link.path().get() );
    response.setStatus( Status.REDIRECTION_SEE_OTHER );
  } );
}
origin: org.restlet.osgi/org.restlet

response.setLocationRef(targetRef);
response.setStatus(Status.REDIRECTION_FOUND);
break;
origin: org.restlet.osgi/org.restlet

for (Header header : headers) {
  if (HEADER_LOCATION.equalsIgnoreCase(header.getName())) {
    response.setLocationRef(header.getValue());
  } else if (HEADER_AGE.equalsIgnoreCase(header.getName())) {
    try {
origin: org.restlet.jse/org.restlet.example

response.setLocationRef(baseRef.toString()
    + remainingPart);
origin: org.qi4j.library/org.qi4j.library.rest-server

.setLocationRef( new Reference( request
                  .getResourceRef()
                  .toString() + "/" ).toString() );
origin: org.restlet.osgi/org.restlet

/**
 * Rewrite the location of the response, and the Location of the entity, if
 * any.
 * 
 * @param request
 *            The request to handle.
 * @param response
 *            The response to update.
 */
public void rewriteLocation(Request request, Response response) {
  if (response.getLocationRef() != null) {
    Reference locationRef = response.getLocationRef();
    String newLocation = getLocation(locationRef, request);
    if (newLocation != null) {
      response.setLocationRef(newLocation);
    }
  }
  if (response.getEntity() != null
      && response.getEntity().getLocationRef() != null) {
    Reference locationRef = response.getEntity().getLocationRef();
    String newLocation = getLocation(locationRef, request);
    if (newLocation != null) {
      response.getEntity().setLocationRef(newLocation);
    }
  }
}
origin: org.restlet.osgi/org.restlet

/**
 * Sets the reference that the client should follow for redirections or
 * resource creations. If you pass a relative location URI, it will be
 * resolved with the current base reference of the request's resource
 * reference (see {@link Request#getResourceRef()} and {@link Reference#getBaseRef()}.<br>
 * <br>
 * Note that when used with HTTP connectors, this property maps to the
 * "Location" header.
 * 
 * @param locationUri
 *            The URI to set.
 * @see #setLocationRef(Reference)
 */
public void setLocationRef(String locationUri) {
  Reference baseRef = null;
  if (getRequest().getResourceRef() != null) {
    if (getRequest().getResourceRef().getBaseRef() != null) {
      baseRef = getRequest().getResourceRef().getBaseRef();
    } else {
      baseRef = getRequest().getResourceRef();
    }
  }
  setLocationRef(new Reference(baseRef, locationUri).getTargetRef());
}
origin: org.qi4j.library/org.qi4j.library.rest-server

Link link = (Link) result;
Reference reference = new Reference( response.getRequest().getResourceRef(), link.href().get() );
response.setLocationRef( reference );
return true;
origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

Link link = (Link) result;
Reference reference = new Reference( response.getRequest().getResourceRef(), link.href().get() );
response.setLocationRef( reference );
return true;
origin: apache/attic-polygene-java

Link link = (Link) result;
Reference reference = new Reference( response.getRequest().getResourceRef(), link.href().get() );
response.setLocationRef( reference );
return true;
org.restletResponsesetLocationRef

Javadoc

Sets the reference that the client should follow for redirections or resource creations. If you pass a relative location URI, it will be resolved with the current base reference of the request's resource reference (see Request#getResourceRef() and Reference#getBaseRef().

Note that when used with HTTP connectors, this property maps to the "Location" header.

Popular methods of Response

  • setStatus
    Sets the status.
  • setEntity
  • getEntity
  • getStatus
    Returns the status.
  • getAttributes
  • getEntityAsText
  • isEntityAvailable
  • getHeaders
  • redirectSeeOther
    Redirects the client to a different URI that SHOULD be retrieved using a GET method on that resource
  • getCookieSettings
    Returns the modifiable series of cookie settings provided by the server. Creates a new instance if n
  • getCurrent
    Returns the response associated to the current thread. Warning: this method should only be used unde
  • getRequest
    Returns the associated request
  • getCurrent,
  • getRequest,
  • getAllowedMethods,
  • getLocationRef,
  • <init>,
  • getCacheDirectives,
  • getServerInfo,
  • commit,
  • getChallengeRequests

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Permission (java.security)
    Legacy security code; do not use.
  • ImageIO (javax.imageio)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now