You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
@jasonpan12 I think this is the same issue as #386 — basically, can_view_path is not a field that is returned by default and since the type of the field is the primitive boolean the BoxCollaboration.Info object defaults it to false when it's not set on the object.
Unfortunately, the SDK does not currently provide a way to request the field; we can fix that! I'll get to that ASAP since it's a quick fix. Once we have the fix made, the necessary code will look something like this:
This whole class of issue is an unfortunate side-effect of using primitives to store these values in the SDK — definitely something we want to address at a higher level throughout the SDK.
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?
The text was updated successfully, but these errors were encountered: