Class StaticFileRestService
java.lang.Object
org.opencastproject.staticfiles.endpoint.StaticFileRestService
Stores and serves static files via HTTP.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key to find the maximum sized file to accept as an upload.static final StringThe default URL path of the static filesstatic final StringThe key to find whether the static file webserver is enabled or not.static final StringThe key to find the URL for where a webserver is hosting the static files.protected booleanWhether to provide urls to download the static files from a webserver without organization and security protection, or use Opencast to provide the files. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGI callback for activating this componentjavax.ws.rs.core.ResponsedeleteStaticFile(String uuid) javax.ws.rs.core.ResponsegetStaticFile(String uuid) javax.ws.rs.core.ResponsegetStaticFileUrl(String uuid) getStaticFileURL(String uuid) Get the URI for a static file resource depending on whether to get it direct from Opencast or from a webserver.javax.ws.rs.core.ResponsepersistFile(String uuid) javax.ws.rs.core.ResponsepostStaticFile(javax.servlet.http.HttpServletRequest request) voidsetSecurityService(SecurityService securityService) OSGi callback to bind service instance.voidsetStaticFileService(StaticFileService staticFileService) OSGi callback to bind service instance.
-
Field Details
-
STATICFILES_URL_PATH
The default URL path of the static files- See Also:
-
STATICFILES_WEBSERVER_ENABLED_KEY
The key to find whether the static file webserver is enabled or not.- See Also:
-
STATICFILES_WEBSERVER_URL_KEY
The key to find the URL for where a webserver is hosting the static files.- See Also:
-
STATICFILES_UPLOAD_MAX_SIZE_KEY
The key to find the maximum sized file to accept as an upload.- See Also:
-
useWebserver
protected boolean useWebserverWhether to provide urls to download the static files from a webserver without organization and security protection, or use Opencast to provide the files.
-
-
Constructor Details
-
StaticFileRestService
public StaticFileRestService()
-
-
Method Details
-
setStaticFileService
OSGi callback to bind service instance. -
setSecurityService
OSGi callback to bind service instance. -
activate
public void activate(org.osgi.service.component.ComponentContext cc) throws org.osgi.service.cm.ConfigurationException OSGI callback for activating this component- Parameters:
cc- the osgi component context- Throws:
org.osgi.service.cm.ConfigurationException
-
getStaticFile
@GET @Path("{uuid}") public javax.ws.rs.core.Response getStaticFile(@PathParam("uuid") String uuid) throws NotFoundException - Throws:
NotFoundException
-
postStaticFile
@POST @Consumes("multipart/form-data") @Produces("text/plain") @Path("") public javax.ws.rs.core.Response postStaticFile(@Context javax.servlet.http.HttpServletRequest request) -
persistFile
@POST @Path("{uuid}/persist") public javax.ws.rs.core.Response persistFile(@PathParam("uuid") String uuid) throws NotFoundException - Throws:
NotFoundException
-
getStaticFileUrl
@GET @Produces("text/plain") @Path("{uuid}/url") public javax.ws.rs.core.Response getStaticFileUrl(@PathParam("uuid") String uuid) throws NotFoundException - Throws:
NotFoundException
-
deleteStaticFile
@DELETE @Path("{uuid}") public javax.ws.rs.core.Response deleteStaticFile(@PathParam("uuid") String uuid) throws NotFoundException - Throws:
NotFoundException
-
getStaticFileURL
Get the URI for a static file resource depending on whether to get it direct from Opencast or from a webserver.- Parameters:
uuid- The unique identifier for the static file.- Returns:
- The URL for the static file resource.
- Throws:
NotFoundException- if the resource couldn't been found
-