Class WorkspaceResource

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response compress​(java.lang.String containerName, CompressInformation compressInformation)
      zip a specific folder into a other directory
      javax.ws.rs.core.Response computeObjectDigest​(java.lang.String containerName, java.lang.String objectName, java.lang.String algo)
      checks if a object exists in an container or compute object Digest
      javax.ws.rs.core.Response createContainer​(java.lang.String containerName)
      creates a container into the workspace
      javax.ws.rs.core.Response createFolder​(java.lang.String containerName, java.lang.String folderName)
      creates a folder into a container
      javax.ws.rs.core.Response deleteContainer​(java.lang.String containerName, boolean recursive)
      deletes a container in the workspace
      javax.ws.rs.core.Response deleteFolder​(java.lang.String containerName, java.lang.String folderName)
      deletes a folder in a container
      javax.ws.rs.core.Response deleteObject​(java.lang.String containerName, java.lang.String objectName)
      Deletes an objects in a container *
      javax.ws.rs.core.Response getBulkObjects​(java.lang.String containerName, java.util.List<java.lang.String> objectURIs)
      gets objects from a container in the workspace as a multiplexed stream
      javax.ws.rs.core.Response getContainerInformation​(java.lang.String containerName)
      Get container information like capacity
      javax.ws.rs.core.Response getFilesWithParamsFromFolder​(java.lang.String containerName, java.lang.String folderName)  
      javax.ws.rs.core.Response getFreespacePercent()
      retrieve free space
      javax.ws.rs.core.Response getObject​(java.lang.String containerName, java.lang.String objectName, java.lang.Long chunkOffset, java.lang.Long maxChunkSize)
      gets an objects from a container in the workspace
      javax.ws.rs.core.Response getObjectInformation​(java.lang.String containerName, java.lang.String objectName)
      gets an objects from a container in the workspace
      javax.ws.rs.core.Response getUriDigitalObjectListByFolder​(java.lang.String containerName, java.lang.String folderName)
      gets the list of URI of object from folder
      javax.ws.rs.core.Response isExistingContainer​(java.lang.String containerName)
      checks if a container exists in the workspace
      javax.ws.rs.core.Response isExistingFolder​(java.lang.String containerName, java.lang.String folderName)
      checks if a folder exists in a container
      javax.ws.rs.core.Response purgeOldFilesInContainer​(java.lang.String containerName, TimeToLive timeToLive)
      deletes old file in a container in the workspace
      javax.ws.rs.core.Response putAtomicObject​(java.io.InputStream stream, java.lang.String containerName, java.lang.String objectName, long size)
      puts an atomic object into a container
      javax.ws.rs.core.Response putObject​(java.io.InputStream stream, java.lang.String containerName, java.lang.String objectName)
      puts an object into a container
      javax.ws.rs.core.Response uncompressObject​(java.io.InputStream stream, java.lang.String containerName, java.lang.String folderName, java.lang.String archiveType)
      uncompress a sip into the workspace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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")
                                                         java.lang.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")
                                                         java.lang.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")
                                                                  java.lang.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")
                                                             java.lang.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")
                                                                 java.lang.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")
                                                      java.lang.String containerName,
                                                      @PathParam("folderName")
                                                      java.lang.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")
                                                      java.lang.String containerName,
                                                      @PathParam("folderName")
                                                      java.lang.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")
                                                          java.lang.String containerName,
                                                          @PathParam("folderName")
                                                          java.lang.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​(java.io.InputStream stream,
                                                          @PathParam("containerName")
                                                          java.lang.String containerName,
                                                          @PathParam("folderName")
                                                          java.lang.String folderName,
                                                          @HeaderParam("Content-Type")
                                                          java.lang.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")
                                                  java.lang.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")
                                                                         java.lang.String containerName,
                                                                         @PathParam("folderName")
                                                                         java.lang.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")
                                                                      java.lang.String containerName,
                                                                      @PathParam("folderName")
                                                                      java.lang.String folderName)
      • putObject

        @Path("/containers/{containerName}/objects/{objectName:.*}")
        @POST
        @Consumes("application/octet-stream")
        @Produces("application/json")
        public javax.ws.rs.core.Response putObject​(java.io.InputStream stream,
                                                   @PathParam("containerName")
                                                   java.lang.String containerName,
                                                   @PathParam("objectName")
                                                   java.lang.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​(java.io.InputStream stream,
                                                         @PathParam("containerName")
                                                         java.lang.String containerName,
                                                         @PathParam("objectName")
                                                         java.lang.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")
                                                      java.lang.String containerName,
                                                      @PathParam("objectName")
                                                      java.lang.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")
                                                   java.lang.String containerName,
                                                   @PathParam("objectName")
                                                   java.lang.String objectName,
                                                   @HeaderParam("X-Vitam-Chunk-Offset")
                                                   java.lang.Long chunkOffset,
                                                   @HeaderParam("X-Vitam-Chunk-Max-Size")
                                                   java.lang.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")
                                                        java.lang.String containerName,
                                                        java.util.List<java.lang.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")
                                                              java.lang.String containerName,
                                                              @PathParam("objectName")
                                                              java.lang.String objectName)
        gets an objects from a container in the workspace
        Parameters:
        containerName - name of container
        objectName - name of object
        Returns:
        Response
        Throws:
        java.io.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")
                                                             java.lang.String containerName,
                                                             @PathParam("objectName")
                                                             java.lang.String objectName,
                                                             @HeaderParam("X-digest-algorithm")
                                                             java.lang.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