Class FileAPI


  • public class FileAPI
    extends BaseAPI
    • Method Detail

      • downloadFile

        public void downloadFile​(int fileId,
                                 File target,
                                 FileSize size)
                          throws IOException
        Downloads the file and saves it to given file
        Parameters:
        fileId - The id of the file to download
        target - The target file to save the contents to
        Throws:
        IOException - If there was an error reading or writing the file
      • uploadFile

        public int uploadFile​(String name,
                              File file)
        Uploads the file to the API
      • 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).