@Component @Scope(value="request") public class FileResource extends Object
| Constructor and Description |
|---|
FileResource() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteFile(String globalId,
String schema,
String version,
String fileName)
Deletes file from representation version.
|
javax.ws.rs.core.Response |
getFile(String globalId,
String schema,
String version,
String fileName,
String range)
Returns file content.
|
javax.ws.rs.core.Response |
sendFile(javax.ws.rs.core.UriInfo uriInfo,
String globalId,
String schema,
String version,
String fileName,
String mimeType,
InputStream data)
Updates a file in a representation version.
|
@PreAuthorize(value="hasPermission(#globalId.concat(\'/\').concat(#schema).concat(\'/\').concat(#version), \'eu.europeana.cloud.common.model.Representation\', write)")
public javax.ws.rs.core.Response sendFile(@Context
javax.ws.rs.core.UriInfo uriInfo,
String globalId,
String schema,
String version,
String fileName,
String mimeType,
InputStream data)
throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException,
eu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException,
eu.europeana.cloud.service.mcs.exception.FileNotExistsException
globalId - cloud id of the record in which the file will be updated (required)schema - schema of representation (required)version - a specific version of the representation(required)fileName - the name of the file(required)mimeType - mime type of filedata - binary stream of file content (required)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - representation does not exist in
specified version.eu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException - specified
representation version is persistent and modifying its files is not
allowed.eu.europeana.cloud.service.mcs.exception.FileNotExistsException - specified file does not exist.@PreAuthorize(value="hasPermission(#globalId.concat(\'/\').concat(#schema).concat(\'/\').concat(#version), \'eu.europeana.cloud.common.model.Representation\', read)") public javax.ws.rs.core.Response getFile(String globalId, String schema, String version, String fileName, @HeaderParam(value="Range") String range) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.FileNotExistsException, eu.europeana.cloud.service.mcs.exception.WrongContentRangeException
globalId - cloud id of the record (required).schema - schema of representation (required).version - a specific version of the representation(required).fileName - the name of the file(required).range - range of bytes to return (optional)eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - representation does not exist in the specified version.eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - representation does not exist in
the specified version.eu.europeana.cloud.service.mcs.exception.WrongContentRangeException - wrong value in "Range" headereu.europeana.cloud.service.mcs.exception.FileNotExistsException - representation version does not have file
with the specified name.@PreAuthorize(value="hasPermission(#globalId.concat(\'/\').concat(#schema).concat(\'/\').concat(#version), \'eu.europeana.cloud.common.model.Representation\', delete)") public void deleteFile(String globalId, String schema, String version, String fileName) throws eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException, eu.europeana.cloud.service.mcs.exception.FileNotExistsException, eu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException
globalId - cloud id of the record (required).schema - schema of representation (required).version - a specific version of the representation(required).fileName - the name of the file(required).eu.europeana.cloud.service.mcs.exception.RepresentationNotExistsException - representation does not exist in
the specified version.eu.europeana.cloud.service.mcs.exception.FileNotExistsException - representation version does not have file
with the specified name.eu.europeana.cloud.service.mcs.exception.CannotModifyPersistentRepresentationException - specified
representation version is persistent and deleting its files is not
allowed.Copyright © 2013–2015 Europeana Cloud Development Team. All rights reserved.