Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arjankowski committed Oct 30, 2024
1 parent 7a2e46a commit 88fd5b4
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/main/java/com/box/sdk/BoxFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ public void downloadRange(OutputStream output, long rangeStart, long rangeEnd, P

/**
* Can be used to override the URL used for file download.
*
* @return URL for file downalod
*/
protected URL getDownloadUrl() {
Expand Down Expand Up @@ -635,14 +636,19 @@ public void updateInfo(BoxFile.Info info) {
* Retrieve a specific file version.
*
* @param fileVersionID the ID of the file version to retrieve.
* @param fields the optional fields to retrieve.
* @param fields the optional fields to retrieve.
* @return a specific file version.
*/
public BoxFileVersion getVersionByID(String fileVersionID, String... fields) {
URL url = BoxFileVersion.VERSION_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), fileVersionID);
if (fields.length > 0) {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
url = BoxFileVersion.VERSION_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID(), fileVersionID);
url = BoxFileVersion.VERSION_URL_TEMPLATE.buildWithQuery(
this.getAPI().getBaseURL(),
queryString,
this.getID(),
fileVersionID
);
}

BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "GET");
Expand Down Expand Up @@ -682,8 +688,8 @@ public Collection<BoxFileVersion> getVersions(String... fields) {
*/
public PartialCollection<BoxFileVersion> getVersionsRange(long offset, long limit, String... fields) {
QueryStringBuilder builder = new QueryStringBuilder()
.appendParam("limit", limit)
.appendParam("offset", offset);
.appendParam("limit", limit)
.appendParam("offset", offset);

if (fields.length > 0) {
builder.appendParam("fields", fields);
Expand Down Expand Up @@ -1460,7 +1466,7 @@ private BoxCollaboration.Info collaborate(JsonObject accessibleByField, BoxColla
itemField.add("type", "file");

return BoxCollaboration.create(this.getAPI(), accessibleByField, itemField, role, notify, canViewPath,
expiresAt, isAccessOnly);
expiresAt, isAccessOnly);
}

/**
Expand Down Expand Up @@ -1508,10 +1514,10 @@ public BoxCollaboration.Info collaborate(BoxCollaborator collaborator, BoxCollab
* Adds a collaborator to this folder. An email will be sent to the collaborator if they don't already have a Box
* account.
*
* @param email the email address of the collaborator to add.
* @param role the role of the collaborator.
* @param notify determines if the user (or all the users in the group) will receive email notifications.
* @param canViewPath whether view path collaboration feature is enabled or not.
* @param email the email address of the collaborator to add.
* @param role the role of the collaborator.
* @param notify determines if the user (or all the users in the group) will receive email notifications.
* @param canViewPath whether view path collaboration feature is enabled or not.
* @param expiresAt when the collaboration should expire.
* @param isAccessOnly whether the collaboration is access only or not.
* @return info about the new collaboration.
Expand Down

0 comments on commit 88fd5b4

Please sign in to comment.