public class FileServiceClient extends Object
| Constructor and Description |
|---|
FileServiceClient(String baseUrl)
Constructs a FileServiceClient
|
FileServiceClient(String baseUrl,
String username,
String password)
Creates instance of FileServiceClient.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteFile(String cloudId,
String representationName,
String version,
String fileName)
Deletes existed file.
|
InputStream |
getFile(String cloudId,
String representationName,
String version,
String fileName)
Function returns file content.
|
InputStream |
getFile(String cloudId,
String representationName,
String version,
String fileName,
String range)
Function returns file content.
|
URI |
modyfiyFile(String cloudId,
String representationName,
String version,
InputStream data,
String mediaType,
String fileName,
String expectedMd5)
Modifies existed file with checking checksum.
|
URI |
uploadFile(String cloudId,
String representationName,
String version,
InputStream data,
String mediaType)
Uploads file content without checking checksum.
|
URI |
uploadFile(String cloudId,
String representationName,
String version,
InputStream data,
String mediaType,
String expectedMd5)
Uploads file content with checking checksum.
|
public FileServiceClient(String baseUrl)
baseUrl - url of the MCS Rest Servicepublic FileServiceClient(String baseUrl, String username, String password)
FileServiceClient(String)
but includes username and password to perform authenticated requests.baseUrl - URL of the MCS Rest Servicepublic InputStream getFile(String cloudId, String representationName, String version, String fileName) throws RepresentationNotExistsException, FileNotExistsException, DriverException, MCSException
cloudId - id of returned file.representationName - representation name of returned file.version - version of returned file.fileName - name of file.RepresentationNotExistsException - when requested representation (or representation version) does not exist.FileNotExistsException - when requested file does not exist.DriverException - call to service has not succeeded because of server side error.MCSException - on unexpected situations.public InputStream getFile(String cloudId, String representationName, String version, String fileName, String range) throws RepresentationNotExistsException, FileNotExistsException, WrongContentRangeException, DriverException, MCSException
cloudId - id of returned file.representationName - representation name of returned file.version - version of returned file.fileName - name of file.range - range of bytes to return. Range header can be found in Hypertext Transfer Protocol HTTP/1.1, section
14.35 Range).RepresentationNotExistsException - when requested representation (or representation version) does not exist.FileNotExistsException - when requested file does not exist.WrongContentRangeException - when wrong value in "Range" header.DriverException - call to service has not succeeded because of server side error.MCSException - on unexpected situations.public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, RepresentationNotExistsException, CannotModifyPersistentRepresentationException, DriverException, MCSException
cloudId - id of uploaded file.representationName - representation name of uploaded file.version - version of uploaded file.data - InputStream (content) of uploaded file.mediaType - mediaType of uploaded file.expectedMd5 - expected MD5 checksum.IOException - when incorrect MD5 checksum.RepresentationNotExistsException - when representation does not exist in specified version.CannotModifyPersistentRepresentationException - when specified representation version is persistent and modifying its files is not allowed.DriverException - call to service has not succeeded because of server side error.MCSException - on unexpected situations.public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType) throws RepresentationNotExistsException, CannotModifyPersistentRepresentationException, DriverException, MCSException
cloudId - id of uploaded file.representationName - representation name of uploaded file.version - version of uploaded file.data - InputStream (content) of uploaded file.mediaType - mediaType of uploaded file.RepresentationNotExistsException - when representation does not exist in specified version.CannotModifyPersistentRepresentationException - when specified representation version is persistent and modifying its files is not allowed.DriverException - call to service has not succeeded because of server side error.MCSException - on unexpected situations.public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, RepresentationNotExistsException, CannotModifyPersistentRepresentationException, DriverException, MCSException
cloudId - id of modifying file.representationName - representation name of modifying file.version - version of modifying file.data - InputStream (content) of modifying file.mediaType - mediaType of modifying file.fileName - name of modifying file.expectedMd5 - expected MD5 checksum.IOException - when checksum is incorrect.RepresentationNotExistsException - when representation does not exist in specified version.CannotModifyPersistentRepresentationException - when specified representation version is persistent and modifying its files is not allowed.DriverException - call to service has not succeeded because of server side error.MCSException - on unexpected situations.public void deleteFile(String cloudId, String representationName, String version, String fileName) throws RepresentationNotExistsException, FileNotExistsException, CannotModifyPersistentRepresentationException, DriverException, MCSException
cloudId - id of deleting file.representationName - representation name of deleting file.version - version of deleting file.fileName - name of deleting file.RepresentationNotExistsException - when representation does not exist in specified version.FileNotExistsException - when requested file does not exist.CannotModifyPersistentRepresentationException - when specified representation version is persistent and modifying its files is not allowed.DriverException - call to service has not succeeded because of server side error.MCSException - on unexpected situations.Copyright © 2013–2014 Europeana Cloud Development Team. All rights reserved.