Class RestUtil.R

java.lang.Object
org.opencastproject.util.RestUtil.R
Enclosing class:
RestUtil

public static final class RestUtil.R extends Object
Response builder functions.
  • Method Details

    • ok

      public static javax.ws.rs.core.Response ok()
    • ok

      public static javax.ws.rs.core.Response ok(Object entity)
    • ok

      public static javax.ws.rs.core.Response ok(boolean entity)
    • ok

      public static javax.ws.rs.core.Response ok(Jsons.Obj json)
    • ok

      public static javax.ws.rs.core.Response ok(Job job)
    • ok

      public static javax.ws.rs.core.Response ok(javax.ws.rs.core.MediaType type, Object entity)
    • ok

      public static javax.ws.rs.core.Response ok(InputStream in, String contentType, Option<Long> streamLength, Option<String> fileName)
      Create a response with status OK from a stream.
      Parameters:
      in - the input stream to read from
      contentType - the content type to set the Content-Type response header to
      streamLength - an optional value for the Content-Length response header
      fileName - an optional file name for the Content-Disposition response header
    • ok

      public static javax.ws.rs.core.Response ok(InputStream in, Option<String> contentType, Option<Long> streamLength, Option<String> fileName)
      Create a response with status OK from a stream.
      Parameters:
      in - the input stream to read from
      contentType - the content type to set the Content-Type response header to
      streamLength - an optional value for the Content-Length response header
      fileName - an optional file name for the Content-Disposition response header
    • created

      public static javax.ws.rs.core.Response created(URI location)
    • notFound

      public static javax.ws.rs.core.Response notFound()
    • notFound

      public static javax.ws.rs.core.Response notFound(Object entity)
    • notFound

      public static javax.ws.rs.core.Response notFound(Object entity, javax.ws.rs.core.MediaType type)
    • locked

      public static javax.ws.rs.core.Response locked()
    • serverError

      public static javax.ws.rs.core.Response serverError()
    • conflict

      public static javax.ws.rs.core.Response conflict()
    • noContent

      public static javax.ws.rs.core.Response noContent()
    • badRequest

      public static javax.ws.rs.core.Response badRequest()
    • badRequest

      public static javax.ws.rs.core.Response badRequest(String msg)
    • forbidden

      public static javax.ws.rs.core.Response forbidden()
    • forbidden

      public static javax.ws.rs.core.Response forbidden(String msg)
    • unauthorized

      public static javax.ws.rs.core.Response unauthorized(Object entity)
    • conflict

      public static javax.ws.rs.core.Response conflict(String msg)
    • preconditionFailed

      public static javax.ws.rs.core.Response preconditionFailed()
      Creates a precondition failed status response
      Returns:
      a precondition failed status response
    • preconditionFailed

      public static javax.ws.rs.core.Response preconditionFailed(String message)
      Creates a precondition failed status response with a message
      Parameters:
      message - The message body
      Returns:
      a precondition failed status response with a message