Class RESTArtifactLoaderService
java.lang.Object
org.exoplatform.services.jcr.ext.artifact.rest.RESTArtifactLoaderService
- All Implemented Interfaces:
org.exoplatform.services.rest.resource.ResourceContainer
public class RESTArtifactLoaderService
extends Object
implements org.exoplatform.services.rest.resource.ResourceContainer
- Version:
- $Id: RESTArtifactLoaderService.java 11:37:47 andrew00x $
- Author:
- Volodymyr Krasnikov volodymyr.krasnikov@exoplatform.com.ua
-
Constructor Summary
ConstructorsConstructorDescriptionRESTArtifactLoaderService(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.jcr.ext.resource.NodeRepresentationService nodeRepresentationService, org.exoplatform.container.ExoContainerContext context) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponsegetResource(String mavenPath, javax.ws.rs.core.UriInfo uriInfo, String view, String gadget) Return Response with Maven artifact if it is file or HTML page for browsing if requested URL is folder.javax.ws.rs.core.ResponsegetRootNodeList(javax.ws.rs.core.UriInfo uriInfo, String view, String gadget) Browsing of root node of Maven repository.protected StringgetStreamAsString(InputStream stream)
-
Constructor Details
-
RESTArtifactLoaderService
public RESTArtifactLoaderService(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.jcr.ext.resource.NodeRepresentationService nodeRepresentationService, org.exoplatform.container.ExoContainerContext context) throws Exception - Parameters:
initParams- the initialized parameters. Set repository name, workspace name, root node for Maven repository, username(optional) and password (optional).sessionProviderService- the SessionProviderService.repositoryService- the RepositoryService.nodeRepresentationService- the NodeRepresentationService.- Throws:
Exception- if any errors occur or not valid configuration.
-
-
Method Details
-
getResource
public javax.ws.rs.core.Response getResource(String mavenPath, @Context javax.ws.rs.core.UriInfo uriInfo, String view, String gadget) Return Response with Maven artifact if it is file or HTML page for browsing if requested URL is folder.- Parameters:
mavenPath- the relative part of requested URL.uriInfo-view-gadget-- Returns:
Response.
-
getRootNodeList
public javax.ws.rs.core.Response getRootNodeList(@Context javax.ws.rs.core.UriInfo uriInfo, String view, String gadget) Browsing of root node of Maven repository.- Parameters:
uriInfo-view-gadget-- Returns:
Response.
-
getStreamAsString
- Parameters:
stream- stream- Returns:
- string representation of stream
- Throws:
IOException- if any i/o errors occurs
-