public class FileAPI extends BaseAPI
| Constructor and Description |
|---|
FileAPI(ResourceFactory resourceFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteFile(int fileId)
Deletes the file with the given id.
|
void |
downloadFile(int fileId,
File target,
FileSize size)
Downloads the file and saves it to given file
|
File |
getFile(int fileId)
Returns the file with the given id
|
List<File> |
getOnApp(int appId,
Integer limit,
Integer offset)
Returns all the files related to the items in the application.
|
List<File> |
getOnSpace(int spaceId,
Integer limit,
Integer offset)
Returns all the files on the space order by the file name.
|
void |
updateFile(int fileId,
FileUpdate update)
Used to update the description of the file.
|
int |
uploadFile(String name,
File file)
Uploads the file to the API
|
Integer |
uploadImage(URL url) |
int |
uploadImage(URL url,
String name) |
getResourceFactorypublic FileAPI(ResourceFactory resourceFactory)
public void downloadFile(int fileId,
File target,
FileSize size)
throws IOException
fileId - The id of the file to downloadtarget - The target file to save the contents toIOException - If there was an error reading or writing the filepublic Integer uploadImage(URL url) throws IOException
IOExceptionpublic int uploadImage(URL url, String name) throws IOException
IOExceptionpublic File getFile(int fileId)
public void updateFile(int fileId,
FileUpdate update)
public void deleteFile(int fileId)
public List<File> getOnApp(int appId, Integer limit, Integer offset)
limit - The maximum number of files to be returned. Defaults to 50 and
cannot be higher than 100.offset - The offset to use when returning files to be used for
pagination. Defaults to 0 (no offset).public List<File> getOnSpace(int spaceId, Integer limit, Integer offset)
limit - The maximum number of files to be returned. Defaults to 50 and
cannot be higher than 100.offset - The offset to use when returning files to be used for
pagination. Defaults to 0 (no offset).Copyright © 2014. All Rights Reserved.