public class FilesService extends EvrythngServiceBase
| Constructor and Description |
|---|
FilesService(ApiManager apiManager) |
| Modifier and Type | Method and Description |
|---|---|
File |
createFileRecordWithUploadUrl(String fileName,
String fileType,
boolean privateAccess,
String... tags)
Creates a metadata record for the given filename, with an 'uploadUrl' that can be used by a client to upload a file using HTTP PUT.
|
boolean |
deleteFileById(String id)
Deletes a
File metadata record by id. |
EvrythngApiBuilder.Builder<File> |
fileCreator(File file)
EvrythngApiBuilder.Builder that creates a new File instance when it is executed. |
EvrythngApiBuilder.Builder<Boolean> |
fileDeleter(String id)
EvrythngApiBuilder.Builder that deletes a File by id when executed. |
EvrythngApiBuilder.Builder<File> |
fileReader(String id)
EvrythngApiBuilder.Builder that returns a single File instance by id when executed. |
EvrythngApiBuilder.Builder<List<File>> |
filesReader(String filter)
EvrythngApiBuilder.Builder that returns a a list of File instances by filter when executed. |
File |
findFileById(String id)
Looks up a
File metadata record by id. |
List<File> |
findFilesByFilter(String filter)
Looks up a list of
File metadata records based on the provided filter. |
absoluteUri, delete, deleteMultiple, encodeBase64, get, getConfig, iterator, mqttUrl, onBuilderCreated, post, post, postAsynchronously, postMultipart, postMultipart, put, put, putMultipart, putMultipart, putMultiple, urlEncodePathPartpublic FilesService(ApiManager apiManager)
public File createFileRecordWithUploadUrl(String fileName, String fileType, boolean privateAccess, String... tags)
fileName - name of the file to be uploaded.fileType - mime-type of file to be uploaded, e.g. text/plain, image/jpg, etc.privateAccess - flag indicating whether or not the file should be privately accessible on remote storage. A value of false means the file will be accessible with a public URL.File metadata instance, with an 'uploadUrl' attribute.public File findFileById(String id)
File metadata record by id. The returned object will have a 'contentUrl' attribute that can be used by a client to download the remote file using HTTP GET.
The 'contentUrl' expires after 30 minutes if the file was marked as 'private'.id - id of the file to retrieve metadata for.File metadata instance, with an 'contentUrl' attribute.public boolean deleteFileById(String id)
File metadata record by id. This method will also delete the actual physical file on remote storage.id - id of the file to be deleted.public List<File> findFilesByFilter(String filter)
File metadata records based on the provided filter.public EvrythngApiBuilder.Builder<File> fileCreator(File file)
EvrythngApiBuilder.Builder that creates a new File instance when it is executed.file - File to be created.EvrythngApiBuilder.Builder to create a new File.public EvrythngApiBuilder.Builder<File> fileReader(String id)
EvrythngApiBuilder.Builder that returns a single File instance by id when executed.id - id of File to find.EvrythngApiBuilder.Builder to find a File by id.public EvrythngApiBuilder.Builder<List<File>> filesReader(String filter)
EvrythngApiBuilder.Builder that returns a a list of File instances by filter when executed.filter - filter criteria to apply. Supported are 'tags=tag1,tag2' and 'name=filename'.EvrythngApiBuilder.Builder to find a list of Files by filter.public EvrythngApiBuilder.Builder<Boolean> fileDeleter(String id)
EvrythngApiBuilder.Builder that deletes a File by id when executed.id - id of File to delete.EvrythngApiBuilder.Builder to delete a File by id.Copyright © 2016 EVRYTHNG Ltd London / Zurich. All rights reserved.