Java Box API Move File
AnsweredSo I am trying to move a file into another folder. The box api says the following
To move a folder, update the ID of its parent.
But there doesn't seem to be a method on the BoxItem.Info to setID(), like there is setName()
I'm trying to do something similar to the api example here
BoxFile file = new BoxFile(api, fileID); BoxFile.Info info = file.new Info(); String parentID = info.getParent().getID(); BoxFolder parentFolder = new BoxFolder(api, parentID); BoxFolder.Info parentInfo = parentFolder.new Info(); parentInfo.setID(newID); // Method doesn't exist parentFolder.updateInfo(parentInfo);
It also seems strange to me that there isn't a file method to simply .move(), it exists for folders.
-
There is actually a method for moving files in the Java SDK! See https://github.com/box/box-java-sdk/blob/master/doc/files.md#move-a-file for more information.
Please sign in to leave a comment.
Comments
1 comment