Package fr.gouv.vitam.workspace.rest
Class WorkspaceResource
- java.lang.Object
-
- fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
-
- fr.gouv.vitam.workspace.rest.WorkspaceResource
-
@Path("/workspace/v1") public class WorkspaceResource extends ApplicationStatusResource
-
-
Field Summary
-
Fields inherited from class fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
STATUS_URL, TENANTS_URL
-
-
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 directoryjavax.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 Digestjavax.ws.rs.core.Response
countObjects(java.lang.String containerName)
Count the number of binary files in the containerjavax.ws.rs.core.Response
createContainer(java.lang.String containerName)
creates a container into the workspacejavax.ws.rs.core.Response
createFolder(java.lang.String containerName, java.lang.String folderName)
creates a folder into a containerjavax.ws.rs.core.Response
deleteContainer(java.lang.String containerName, boolean recursive)
deletes a container in the workspacejavax.ws.rs.core.Response
deleteFolder(java.lang.String containerName, java.lang.String folderName)
deletes a folder in a containerjavax.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 streamjavax.ws.rs.core.Response
getContainerInformation(java.lang.String containerName)
Get container information like capacityjavax.ws.rs.core.Response
getFilesWithParamsFromFolder(java.lang.String containerName, java.lang.String folderName)
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 workspacejavax.ws.rs.core.Response
getObjectInformation(java.lang.String containerName, java.lang.String objectName)
gets an objects from a container in the workspacejavax.ws.rs.core.Response
getUriDigitalObjectListByFolder(java.lang.String containerName, java.lang.String folderName)
gets the list of URI of object from folderjavax.ws.rs.core.Response
isExistingContainer(java.lang.String containerName)
checks if a container exists in the workspacejavax.ws.rs.core.Response
isExistingFolder(java.lang.String containerName, java.lang.String folderName)
checks if a folder exists in a containerjavax.ws.rs.core.Response
purgeOldFilesInContainer(java.lang.String containerName, TimeToLive timeToLive)
deletes old file in a container in the workspacejavax.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 containerjavax.ws.rs.core.Response
putObject(java.io.InputStream stream, java.lang.String containerName, java.lang.String objectName)
puts an object into a containerjavax.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 fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
getServerTenants, status
-
-
-
-
Method Detail
-
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 namerecursive
- 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
-
countObjects
@Path("/containers/{containerName}/count") @GET @Produces("application/json") public javax.ws.rs.core.Response countObjects(@PathParam("containerName") java.lang.String containerName)
Count the number of binary files in the container- Parameters:
containerName
- path param for container name- Returns:
- Response containing the number of objects in "objectNumber"
-
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 namefolderName
- 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 namefolderName
- 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 namefolderName
- 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 streamcontainerName
- name of containerfolderName
- name of folderarchiveType
- 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 containerfolderName
- 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 streamobjectName
- name of data objectcontainerName
- 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 streamobjectName
- name of data objectcontainerName
- 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 nameobjectName
- 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 containerobjectName
- 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 containerobjectURIs
- 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) throws java.io.IOException
gets an objects from a container in the workspace- Parameters:
containerName
- name of containerobjectName
- 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 containerobjectName
- name of objectalgo
- path parameter of algo- Returns:
- Response
-
-