@HTTPService(name="fsrc") public class ClientService extends java.lang.Object
FileService
Constructor and Description |
---|
ClientService() |
Modifier and Type | Method and Description |
---|---|
Response |
addFile(AuthenticationParameter authenticatedUser,
InputStreamParameter file,
StringParameter filename)
This method allows an authenticated user to upload a file directly using HTTP Post.
|
void |
deleteFile(AuthenticationParameter authenticatedUser,
LongParameter fileId)
This method can be used to delete one or more files.
|
Response |
listFiles(AuthenticationParameter authenticatedUser,
LongParameter fileId,
Limits limits)
List all or a subset of the files user has uploaded to the system.
|
public ClientService()
@HTTPServiceMethod(name="addFile", acceptedMethods="POST") public Response addFile(@HTTPAuthenticationParameter(required=false) AuthenticationParameter authenticatedUser, @HTTPMethodParameter(name="body",bodyParameter=true) InputStreamParameter file, @HTTPMethodParameter(name="filename",required=false) StringParameter filename)
authenticatedUser
- Note: this method requires authentication, but for the reference implementation, anonymous access is granted.file
- file contentsfilename
- Optional filename for the uploaded data. The filename is processed simply as metadata and omitting the parameter has no effect on the file upload.FileList
@HTTPServiceMethod(name="deleteFile", acceptedMethods="DELETE") public void deleteFile(@HTTPAuthenticationParameter(required=false) AuthenticationParameter authenticatedUser, @HTTPMethodParameter(name="file_id") LongParameter fileId)
authenticatedUser
- Note: this method requires authentication, but for the reference implementation, anonymous access is granted.fileId
- @HTTPServiceMethod(name="listFiles", acceptedMethods="GET") public Response listFiles(@HTTPAuthenticationParameter(required=false) AuthenticationParameter authenticatedUser, @HTTPMethodParameter(name="file_id",required=false) LongParameter fileId, @HTTPMethodParameter(name="limits",required=false) Limits limits)
authenticatedUser
- Note: this method requires authentication, but for the reference implementation, anonymous access is granted.fileId
- Optional file ID filter for retrieving a subset of the uploaded files. If ID is not given, all files will be retrieved respecting the optional limits parameter.limits
- paging limitsFileList
Copyright © 2015 Tampere University of Technology, Pori Department.