-
Notifications
You must be signed in to change notification settings - Fork 186
Description
- I have checked that the SDK documentation and API documentation doesn't solve my issue
Description of the Issue
Hey guys! Writing in on behalf of a Japanese customer, while I don't have a Java test environment myself so apologies in advance for any Java faux pas.
In response to #560, it looks like getCanViewPath
It always returns "false" even though the actual value should be "true".
It seems that the value of canViewPath can only be retrieved/returned when it is set, but can't be get'd. Instead, the value always seems to return false.
Versions Used
Java SDK: Version is 2.14.0
Java: // Replace with the version of Java your application is running on.
Steps to Reproduce
-----Summary------
//invite the target user to the target folder (canviewpath=true)
String trueCollaboId = folder.collaborate(user,
BoxCollaboration.Role.EDITOR, false, true).getID();
System.out.println(trueCollaboId); //Result:13114521128
//Get information of above collaboration. Even though canViewPath is
true, result is always false.
BoxCollaboration trueCollabo = new BoxCollaboration(api, trueCollaboId);
BoxCollaboration.Info trueCollaboInfo = trueCollabo.getInfo();
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:false
System.out.println(trueCollaboInfo.getRole()); //Result:EDITOR
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED
-----Summary------
-----Details------
Version is 2.14.0
//Enter box credential (Let me skip details about the credential here)
BoxAPIConnection api;
//Target folder
BoxFolder folder = new BoxFolder(api, "removed");
//Target user
BoxUser user = new BoxUser(api, "removed");
/** canviewpath=true **/
//invite the target user to the target folder (canviewpath=true)
String trueCollaboId = folder.collaborate(user,
BoxCollaboration.Role.EDITOR, false, true).getID();
System.out.println(trueCollaboId); //Result: collab_id value
//Get information of above collaboration. Even though canViewPath is
true, result is always false.
BoxCollaboration trueCollabo = new BoxCollaboration(api, trueCollaboId);
BoxCollaboration.Info trueCollaboInfo = trueCollabo.getInfo();
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:false
System.out.println(trueCollaboInfo.getRole()); //Result:EDITOR
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED
// Set canviewpath=true via setCanViewPath, then call getCanViewPath, it
returns true.
trueCollaboInfo.setRole(BoxCollaboration.Role.VIEWER);
trueCollaboInfo.setCanViewPath(true);
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:true
System.out.println(trueCollaboInfo.getRole()); //Result:VIEWER
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED
// Do the updateInfo to make sure
trueCollabo.updateInfo(trueCollaboInfo);
System.out.println(trueCollaboInfo.getCanViewPath()); //Result:true
System.out.println(trueCollaboInfo.getRole()); //Result:VIEWER
System.out.println(trueCollaboInfo.getStatus()); //Result:ACCEPTED
// Get it as a different object, it returns false even though the actual
value is true
BoxCollaboration trueCollabo2 = new BoxCollaboration(api, trueCollaboId);
BoxCollaboration.Info trueCollaboInfo2 = trueCollabo2.getInfo();
System.out.println(trueCollaboInfo2.getCanViewPath()); //Result:false
System.out.println(trueCollaboInfo2.getRole()); //Result:VIEWER
System.out.println(trueCollaboInfo2.getStatus()); //Result:ACCEPTED
/** canviewpath=false**/
// Delete the collaboration first
trueCollabo.delete();
// invite the target user to the target folder (canviewpath=false)
String falseCollaboId = folder.collaborate(user,
BoxCollaboration.Role.EDITOR, false, false).getID();
System.out.println(falseCollaboId); //Result:13114516801
// Get information of above collaboration. Result is false and that is
expected.
BoxCollaboration falseCollabo = new BoxCollaboration(api, falseCollaboId);
BoxCollaboration.Info falseCollaboInfo = falseCollabo.getInfo();
System.out.println(falseCollaboInfo.getCanViewPath()); //Result:false
System.out.println(falseCollaboInfo.getRole()); //Result:EDITOR
System.out.println(falseCollaboInfo.getStatus()); //Result:ACCEPTED
// Call setCanViewPath to set canviewpath=true
falseCollaboInfo.setRole(BoxCollaboration.Role.VIEWER);
falseCollaboInfo.setCanViewPath(true);
System.out.println(falseCollaboInfo.getCanViewPath()); //Result:true
System.out.println(falseCollaboInfo.getRole()); //Result:VIEWER
System.out.println(falseCollaboInfo.getStatus()); //Result:ACCEPTED
// Do the updateInfo to make sure
falseCollabo.updateInfo(falseCollaboInfo);
System.out.println(falseCollaboInfo.getCanViewPath()); //Result:true
System.out.println(falseCollaboInfo.getRole()); //Result:VIEWER
System.out.println(falseCollaboInfo.getStatus()); //Result:ACCEPTED
// Get it as a different object, it returns false even though the actual
value is true
BoxCollaboration falseCollabo2 = new BoxCollaboration(api, falseCollaboId);
BoxCollaboration.Info falseCollaboInfo2 = falseCollabo2.getInfo();
System.out.println(falseCollaboInfo2.getCanViewPath()); //Result:false
System.out.println(falseCollaboInfo2.getRole()); //Result:VIEWER
System.out.println(falseCollaboInfo2.getStatus()); //Result:ACCEPTED
-----Details----
Error Message, Including Stack Trace
Ehh... just the above?