Class Artifact
java.lang.Object
org.wso2.carbon.registry.rest.api.RegistryRestSuper
org.wso2.carbon.registry.rest.api.Artifact
This class is to handle the resources/collections according to the REST verbs GET,PUT and DELETE.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponsecreateResource(List<javax.ws.rs.core.PathSegment> path, InputStream contentStream, String contentType, String JWTToken) This method creates/update the resource sent as the payload to the registry.javax.ws.rs.core.ResponsedeleteResource(List<javax.ws.rs.core.PathSegment> path, String JWTToken) This method delete the requested resource.javax.ws.rs.core.ResponsegetResource(List<javax.ws.rs.core.PathSegment> path, String JWTToken) This method get the resource content of the requested resource.Methods inherited from class org.wso2.carbon.registry.rest.api.RegistryRestSuper
getBegin, getEnd, getPageSize, getResourcePath, getTenantID, getUserRegistry, getUserRegistry, setBegin, setEnd, setPageSize, setUserRegistry
-
Constructor Details
-
Artifact
public Artifact()
-
-
Method Details
-
getResource
@Path("/{path:.*}") public javax.ws.rs.core.Response getResource(List<javax.ws.rs.core.PathSegment> path, @HeaderParam("X-JWT-Assertion") String JWTToken) This method get the resource content of the requested resource. If the path is collection it returns the paths inside that collection. If resource it return the content of the resource.- Parameters:
path- - Path of the resource/collection in the registry.- Returns:
- Response, if resource content stream, else resource paths array.HTTP 200 OK.
-
createResource
@Path("/{path:.*}") public javax.ws.rs.core.Response createResource(List<javax.ws.rs.core.PathSegment> path, InputStream contentStream, @HeaderParam("Content-Type") String contentType, @HeaderParam("X-JWT-Assertion") String JWTToken) This method creates/update the resource sent as the payload to the registry.- Parameters:
path- - List of path segment of the resource path after the (/resource) in the URIcontentStream- - Resource content sent as stream- Returns:
- Response - HTTP 200 OK with the resource/collection path.
-
deleteResource
@Path("/{path:.*}") public javax.ws.rs.core.Response deleteResource(List<javax.ws.rs.core.PathSegment> path, @HeaderParam("X-JWT-Assertion") String JWTToken) This method delete the requested resource.- Parameters:
path- - path segment of the resource path- Returns:
- Response - HTTP 204 No Content.
-