Package com.podio.file
Class FileAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.file.FileAPI
-
public class FileAPI extends BaseAPI
-
-
Constructor Summary
Constructors Constructor Description FileAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteFile(int fileId)Deletes the file with the given id.voiddownloadFile(int fileId, File target, FileSize size)Downloads the file and saves it to given fileFilegetFile(int fileId)Returns the file with the given idList<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.voidupdateFile(int fileId, FileUpdate update)Used to update the description of the file.intuploadFile(String name, File file)Uploads the file to the APIIntegeruploadImage(URL url)intuploadImage(URL url, String name)-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
FileAPI
public FileAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
downloadFile
public void downloadFile(int fileId, File target, FileSize size) throws IOExceptionDownloads the file and saves it to given file- Parameters:
fileId- The id of the file to downloadtarget- The target file to save the contents to- Throws:
IOException- If there was an error reading or writing the file
-
uploadImage
public Integer uploadImage(URL url) throws IOException
- Throws:
IOException
-
uploadImage
public int uploadImage(URL url, String name) throws IOException
- Throws:
IOException
-
getFile
public File getFile(int fileId)
Returns the file with the given id
-
updateFile
public void updateFile(int fileId, FileUpdate update)Used to update the description of the file.
-
deleteFile
public void deleteFile(int fileId)
Deletes the file with the given id.
-
getOnApp
public List<File> getOnApp(int appId, Integer limit, Integer offset)
Returns all the files related to the items in the application. This includes files both on the item itself and in comments on the item.- Parameters:
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).
-
getOnSpace
public List<File> getOnSpace(int spaceId, Integer limit, Integer offset)
Returns all the files on the space order by the file name.- Parameters:
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).
-
-