Class GroupFileService

java.lang.Object
com.bitheads.braincloud.services.GroupFileService

public class GroupFileService
extends Object
  • Constructor Details

  • Method Details

    • checkFilenameExists

      public void checkFilenameExists​(String groupId, String folderPath, String filename, IServerCallback callback)
      Check if filename exists for provided path and name.
      Parameters:
      groupId - ID of the group
      folderPath - File located cloud path/folder
      filename - File cloud name
      callback - The method to be invoked when the server response is received
    • checkFullpathFilenameExists

      public void checkFullpathFilenameExists​(String groupId, String fullPathFilename, IServerCallback callback)
      Check if filename exists for provided path and name.
      Parameters:
      groupId - ID of the group
      fullPathFilename - File cloud name in full path
      callback - The method to be invoked when the server response is received
    • copyFile

      public void copyFile​(String groupId, String fileId, int version, String newTreeId, int treeVersion, String newFilename, boolean overwriteIfPresent, IServerCallback callback)
      Copy a file.
      Parameters:
      groupId - ID of the group
      fileId - ID of the file
      version - Target version of the file
      newTreeId - ID of the destination folder
      treeVersion - Target version of the folder tree
      newFilename - Optional new file name
      overwriteIfPresent - Whether to allow overwrite of an existing file if present
      callback - The method to be invoked when the server response is received
    • deleteFile

      public void deleteFile​(String groupId, String fileId, int version, String filename, IServerCallback callback)
      Delete a file.
      Parameters:
      groupId - ID of the group
      fileId - ID of the file
      version - Target version of the file
      filename - File name for verification purposes
      callback - The method to be invoked when the server response is received
    • getCDNUrl

      public void getCDNUrl​(String groupId, String fileId, IServerCallback callback)
      Return the CDN url for file for clients that cannot handle redirect
      Parameters:
      groupId - ID of the group
      fileId - ID of the file
      callback - The method to be invoked when the server response is received
    • getFileInfo

      public void getFileInfo​(String groupId, String fileId, IServerCallback callback)
      Returns information on a file using fileId.
      Parameters:
      groupId - ID of the group
      fileId - ID of the file
      callback - The method to be invoked when the server response is received
    • getFileInfoSimple

      public void getFileInfoSimple​(String groupId, String folderPath, String filename, IServerCallback callback)
      Returns information on a file using path and name.
      Parameters:
      groupId - ID of the group
      folderPath - Folder path
      filename - File name
      callback - The method to be invoked when the server response is received
    • getFileList

      public void getFileList​(String groupId, String folderPath, boolean recurse, IServerCallback callback)
      Returns a list of files.
      Parameters:
      groupId - ID of group
      folderPath - Folder path
      recurse - Whether to recurse beyond the starting folder
      callback - The method to be invoked when the server response is received
    • moveFile

      public void moveFile​(String groupId, String fileId, int version, String newTreeId, int treeVersion, String newFilename, boolean overwriteIfPresent, IServerCallback callback)
      Move a file.
      Parameters:
      groupId - ID of the group
      fileId - ID of the file
      version - Target version of the file. As an option, you can use -1 for the latest version of the file
      newTreeId - ID of the destination folder
      treeVersion - Target version of the folder tree
      newFilename - Optional new file name
      overwriteIfPresent - Whether to allow overwrite of an existing file if present
      callback - The method to be invoked when the server response is received
    • moveUserToGroupFile

      public void moveUserToGroupFile​(String userCloudPath, String userCloudFilename, String groupId, String groupTreeId, String groupFileName, org.json.JSONObject groupFileAcl, boolean overwriteIfPresent, IServerCallback callback)
      Move a file from user space to group space.
      Parameters:
      userCloudPath - User file folder
      userCloudFilename - User file name
      groupId - ID of the group
      groupTreeId - ID of the destination folder
      groupFileName - Group file name
      groupFileAcl - Acl of the new group file
      overwriteIfPresent - Whether to allow overwrite of an existing file if present
      callback - The method to be invoked when the server response is received
    • updateFileInfo

      public void updateFileInfo​(String groupId, String fileId, int version, String newFilename, org.json.JSONObject newACL, IServerCallback callback)
      Rename or edit permissions of an uploaded file. Does not change the contents of the file.
      Parameters:
      groupId - ID of the group
      fileId - ID of the file
      version - Target version of the file
      newFilename - Optional new file name
      newACL - Optional new acl
      callback - The method to be invoked when the server response is received