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
-
Field Summary
Fields inherited from class fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
STATUS_URL, TENANTS_URL
-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
compress
(String containerName, CompressInformation compressInformation) zip a specific folder into a other directoryjavax.ws.rs.core.Response
computeObjectDigest
(String containerName, String objectName, String algo) checks if a object exists in an container or compute object Digestjavax.ws.rs.core.Response
createContainer
(String containerName) creates a container into the workspacejavax.ws.rs.core.Response
createFolder
(String containerName, String folderName) creates a folder into a containerjavax.ws.rs.core.Response
deleteContainer
(String containerName, boolean recursive) deletes a container in the workspacejavax.ws.rs.core.Response
deleteFolder
(String containerName, String folderName) deletes a folder in a containerjavax.ws.rs.core.Response
deleteObject
(String containerName, String objectName) Deletes an objects in a container *javax.ws.rs.core.Response
getBulkObjects
(String containerName, List<String> objectURIs) gets objects from a container in the workspace as a multiplexed streamjavax.ws.rs.core.Response
getContainerInformation
(String containerName) Get container information like capacityjavax.ws.rs.core.Response
getFilesWithParamsFromFolder
(String containerName, String folderName) javax.ws.rs.core.Response
retrieve free spacejavax.ws.rs.core.Response
gets an objects from a container in the workspacejavax.ws.rs.core.Response
getObjectInformation
(String containerName, String objectName) gets an objects from a container in the workspacejavax.ws.rs.core.Response
getUriDigitalObjectListByFolder
(String containerName, String folderName) gets the list of URI of object from folderjavax.ws.rs.core.Response
isExistingContainer
(String containerName) checks if a container exists in the workspacejavax.ws.rs.core.Response
isExistingFolder
(String containerName, String folderName) checks if a folder exists in a containerjavax.ws.rs.core.Response
purgeOldFilesInContainer
(String containerName, TimeToLive timeToLive) deletes old file in a container in the workspacejavax.ws.rs.core.Response
putAtomicObject
(InputStream stream, String containerName, String objectName, long size) puts an atomic object into a containerjavax.ws.rs.core.Response
putObject
(InputStream stream, String containerName, String objectName) puts an object into a containerjavax.ws.rs.core.Response
uncompressObject
(InputStream stream, String containerName, String folderName, String archiveType) uncompress a sip into the workspaceMethods inherited from class fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
getServerTenants, status
-
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 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") 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 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") String containerName, @PathParam("folderName") 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") String containerName, @PathParam("folderName") 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(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 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") 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 containerfolderName
- name of folder- Returns:
- Response
-
getFilesWithParamsFromFolder
-
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 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(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 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") String containerName, @PathParam("objectName") 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") 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 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") String containerName, List<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") String containerName, @PathParam("objectName") String objectName) gets an objects from a container in the workspace- Parameters:
containerName
- name of containerobjectName
- 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 containerobjectName
- name of objectalgo
- path parameter of algo- Returns:
- Response
-