Class WorkspaceResource


@Path("/v1") public class WorkspaceResource extends ApplicationStatusResource
  • Method Details

    • getFreespacePercent

      @Path("/freespace") @GET @Produces("application/json") public javax.ws.rs.core.Response getFreespacePercent()
      retrieve free space
      Returns:
      free space percentage
    • createContainer

      @Path("/containers/{containerName}") @POST @Produces("application/json") public javax.ws.rs.core.Response createContainer(@PathParam("containerName") String containerName)
      creates a container into the workspace
      Parameters:
      containerName - as path param
      Returns:
      Response
    • deleteContainer

      @Path("/containers/{containerName}") @DELETE @Produces("application/json") public javax.ws.rs.core.Response deleteContainer(@PathParam("containerName") String containerName, @HeaderParam("X-Recursive") boolean recursive)
      deletes a container in the workspace
      Parameters:
      containerName - path param of container name
      recursive - true if the container should be deleted recursively
      Returns:
      Response
    • purgeOldFilesInContainer

      @Path("/containers/{containerName}/old_files") @DELETE @Produces("application/json") public javax.ws.rs.core.Response purgeOldFilesInContainer(@PathParam("containerName") String containerName, TimeToLive timeToLive)
      deletes old file in a container in the workspace
    • isExistingContainer

      @Path("/containers/{containerName}") @HEAD @Produces("application/json") public javax.ws.rs.core.Response isExistingContainer(@PathParam("containerName") String containerName)
      checks if a container exists in the workspace
      Parameters:
      containerName - path param for container name
      Returns:
      Response
    • getContainerInformation

      @Path("/container/{containerName}") @GET @Produces("application/json") public javax.ws.rs.core.Response getContainerInformation(@PathParam("containerName") String containerName)
      Get container information like capacity
      Parameters:
      containerName - the container name
      Returns:
      a Json with usableSpace information
    • createFolder

      @Path("/containers/{containerName}/folders/{folderName:.*}") @POST @Produces("application/json") public javax.ws.rs.core.Response createFolder(@PathParam("containerName") String containerName, @PathParam("folderName") String folderName)
      creates a folder into a container
      Parameters:
      containerName - path param of container name
      folderName - path param of folder
      Returns:
      Response
    • deleteFolder

      @Path("/containers/{containerName}/folders/{folderName:.*}") @DELETE @Produces("application/json") public javax.ws.rs.core.Response deleteFolder(@PathParam("containerName") String containerName, @PathParam("folderName") String folderName)
      deletes a folder in a container
      Parameters:
      containerName - path param for container name
      folderName - path param for folder name
      Returns:
      Response
    • isExistingFolder

      @Path("/containers/{containerName}/folders/{folderName:.*}") @HEAD @Produces("application/json") public javax.ws.rs.core.Response isExistingFolder(@PathParam("containerName") String containerName, @PathParam("folderName") String folderName)
      checks if a folder exists in a container
      Parameters:
      containerName - path param for container name
      folderName - path param for folder name
      Returns:
      Response
    • uncompressObject

      @Path("/containers/{containerName}/folders/{folderName:.*}") @PUT @Consumes({"application/zip","application/x-gzip","application/gzip","application/x-tar","application/x-bzip2"}) @Produces("application/json") public javax.ws.rs.core.Response uncompressObject(InputStream stream, @PathParam("containerName") String containerName, @PathParam("folderName") String folderName, @HeaderParam("Content-Type") String archiveType)
      uncompress a sip into the workspace
      Parameters:
      stream - data input stream
      containerName - name of container
      folderName - name of folder
      archiveType - the type of archive
      Returns:
      Response
    • compress

      @Path("/containers/{containerName}") @POST @Consumes("application/json") public javax.ws.rs.core.Response compress(@PathParam("containerName") String containerName, CompressInformation compressInformation)
      zip a specific folder into a other directory
      Parameters:
      containerName -
      Returns:
    • getUriDigitalObjectListByFolder

      @Path("/containers/{containerName}/folders/{folderName:.*}") @GET @Produces("application/json") public javax.ws.rs.core.Response getUriDigitalObjectListByFolder(@PathParam("containerName") String containerName, @PathParam("folderName") String folderName)
      gets the list of URI of object from folder
      Parameters:
      containerName - name of container
      folderName - name of folder
      Returns:
      Response
    • getFilesWithParamsFromFolder

      @Path("/containers/{containerName}/folders/{folderName:.*}/filesWithParams") @GET @Produces("application/json") public javax.ws.rs.core.Response getFilesWithParamsFromFolder(@PathParam("containerName") String containerName, @PathParam("folderName") String folderName)
    • putObject

      @Path("/containers/{containerName}/objects/{objectName:.*}") @POST @Consumes("application/octet-stream") @Produces("application/json") public javax.ws.rs.core.Response putObject(InputStream stream, @PathParam("containerName") String containerName, @PathParam("objectName") String objectName)
      puts an object into a container
      Parameters:
      stream - data input stream
      objectName - name of data object
      containerName - name of container
      Returns:
      Response
    • putAtomicObject

      @Path("/atomic_containers/{containerName}/objects/{objectName:.*}") @POST @Consumes("application/octet-stream") @Produces("application/json") public javax.ws.rs.core.Response putAtomicObject(InputStream stream, @PathParam("containerName") String containerName, @PathParam("objectName") String objectName, @HeaderParam("X-Content-Length") long size)
      puts an atomic object into a container
      Parameters:
      stream - data input stream
      objectName - name of data object
      containerName - name of container
      Returns:
      Response
    • deleteObject

      @Path("/containers/{containerName}/objects/{objectName:.*}") @DELETE @Produces("application/json") public javax.ws.rs.core.Response deleteObject(@PathParam("containerName") String containerName, @PathParam("objectName") String objectName)
      Deletes an objects in a container *
      Parameters:
      containerName - container name
      objectName - object name
      Returns:
      Response
    • getObject

      @Path("/containers/{containerName}/objects/{objectName:.*}") @GET @Produces("application/octet-stream") public javax.ws.rs.core.Response getObject(@PathParam("containerName") String containerName, @PathParam("objectName") String objectName, @HeaderParam("X-Vitam-Chunk-Offset") Long chunkOffset, @HeaderParam("X-Vitam-Chunk-Max-Size") Long maxChunkSize)
      gets an objects from a container in the workspace
      Parameters:
      containerName - name of container
      objectName - name of object
      Returns:
      response
    • getBulkObjects

      @Path("/containers/{containerName}/objects") @GET @Produces("application/octet-stream") @Consumes("application/json") public javax.ws.rs.core.Response getBulkObjects(@PathParam("containerName") String containerName, List<String> objectURIs)
      gets objects from a container in the workspace as a multiplexed stream
      Parameters:
      containerName - name of container
      objectURIs - the list of document Uris
      Returns:
      response
    • getObjectInformation

      @Path("/containers/{containerName}/objects/{objectName:.*}") @GET @Produces("application/json") public javax.ws.rs.core.Response getObjectInformation(@PathParam("containerName") String containerName, @PathParam("objectName") String objectName)
      gets an objects from a container in the workspace
      Parameters:
      containerName - name of container
      objectName - name of object
      Returns:
      Response
      Throws:
      IOException - when there is an error of get object
    • computeObjectDigest

      @Path("/containers/{containerName}/objects/{objectName:.*}") @HEAD @Produces("application/json") public javax.ws.rs.core.Response computeObjectDigest(@PathParam("containerName") String containerName, @PathParam("objectName") String objectName, @HeaderParam("X-digest-algorithm") String algo)
      checks if a object exists in an container or compute object Digest
      Parameters:
      containerName - name of container
      objectName - name of object
      algo - path parameter of algo
      Returns:
      Response