Package com.bitheads.braincloud.services
Class GroupFileService
java.lang.Object
com.bitheads.braincloud.services.GroupFileService
public class GroupFileService extends Object
-
Constructor Summary
Constructors Constructor Description GroupFileService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidcheckFilenameExists(String groupId, String folderPath, String filename, IServerCallback callback)Check if filename exists for provided path and name.voidcheckFullpathFilenameExists(String groupId, String fullPathFilename, IServerCallback callback)Check if filename exists for provided path and name.voidcopyFile(String groupId, String fileId, int version, String newTreeId, int treeVersion, String newFilename, boolean overwriteIfPresent, IServerCallback callback)Copy a file.voiddeleteFile(String groupId, String fileId, int version, String filename, IServerCallback callback)Delete a file.voidgetCDNUrl(String groupId, String fileId, IServerCallback callback)Return the CDN url for file for clients that cannot handle redirectvoidgetFileInfo(String groupId, String fileId, IServerCallback callback)Returns information on a file using fileId.voidgetFileInfoSimple(String groupId, String folderPath, String filename, IServerCallback callback)Returns information on a file using path and name.voidgetFileList(String groupId, String folderPath, boolean recurse, IServerCallback callback)Returns a list of files.voidmoveFile(String groupId, String fileId, int version, String newTreeId, int treeVersion, String newFilename, boolean overwriteIfPresent, IServerCallback callback)Move a file.voidmoveUserToGroupFile(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.voidupdateFileInfo(String groupId, String fileId, int version, String newFilename, org.json.JSONObject newACL, IServerCallback callback)Rename or edit permissions of an uploaded file.
-
Constructor Details
-
GroupFileService
-
-
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 groupfolderPath- File located cloud path/folderfilename- File cloud namecallback- 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 groupfullPathFilename- File cloud name in full pathcallback- 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 groupfileId- ID of the fileversion- Target version of the filenewTreeId- ID of the destination foldertreeVersion- Target version of the folder treenewFilename- Optional new file nameoverwriteIfPresent- Whether to allow overwrite of an existing file if presentcallback- 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 groupfileId- ID of the fileversion- Target version of the filefilename- File name for verification purposescallback- The method to be invoked when the server response is received
-
getCDNUrl
Return the CDN url for file for clients that cannot handle redirect- Parameters:
groupId- ID of the groupfileId- ID of the filecallback- The method to be invoked when the server response is received
-
getFileInfo
Returns information on a file using fileId.- Parameters:
groupId- ID of the groupfileId- ID of the filecallback- 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 groupfolderPath- Folder pathfilename- File namecallback- 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 groupfolderPath- Folder pathrecurse- Whether to recurse beyond the starting foldercallback- 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 groupfileId- ID of the fileversion- Target version of the file. As an option, you can use -1 for the latest version of the filenewTreeId- ID of the destination foldertreeVersion- Target version of the folder treenewFilename- Optional new file nameoverwriteIfPresent- Whether to allow overwrite of an existing file if presentcallback- 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 folderuserCloudFilename- User file namegroupId- ID of the groupgroupTreeId- ID of the destination foldergroupFileName- Group file namegroupFileAcl- Acl of the new group fileoverwriteIfPresent- Whether to allow overwrite of an existing file if presentcallback- 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 groupfileId- ID of the fileversion- Target version of the filenewFilename- Optional new file namenewACL- Optional new aclcallback- The method to be invoked when the server response is received
-