-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20ac376
commit 474c5a1
Showing
12 changed files
with
637 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
SendSafelyAPI/src/com/sendsafely/dto/request/GetDownloadUrlsFromDirectoryRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.sendsafely.dto.request; | ||
|
||
import com.sendsafely.enums.GetParam; | ||
import com.sendsafely.enums.HTTPMethod; | ||
import com.sendsafely.json.JsonManager; | ||
|
||
public class GetDownloadUrlsFromDirectoryRequest extends BaseRequest { | ||
|
||
private HTTPMethod method = HTTPMethod.POST; | ||
private String path = "/package/" + GetParam.PACKAGE_ID + "/directory/" + GetParam.DIRECTORY_ID + "/file/" + GetParam.FILE_ID + "/download-urls/"; | ||
|
||
public GetDownloadUrlsFromDirectoryRequest(JsonManager jsonManager){ | ||
initialize(jsonManager, method, path); | ||
} | ||
|
||
public void setPackageId(String packageId) { | ||
super.setGetParam(GetParam.PACKAGE_ID, packageId); | ||
} | ||
|
||
public void setFileId(String fileId) { | ||
super.setGetParam(GetParam.FILE_ID, fileId); | ||
} | ||
|
||
public void setDirectoryId(String directoryId){ | ||
super.setGetParam(GetParam.DIRECTORY_ID, directoryId); | ||
} | ||
|
||
public void setStartSegment(int start) { | ||
super.setPostParam("startSegment", start); | ||
} | ||
|
||
public void setEndSegment(int end) { | ||
super.setPostParam("endSegment", end); | ||
} | ||
public void setPackageCode(String packageCode){ | ||
super.setPostParam("packageCode", packageCode); | ||
} | ||
public void setChecksum(String checksum){ | ||
super.setPostParam("checksum", checksum); | ||
} | ||
public void setForceProxy(boolean forceProxy){ | ||
super.setPostParam("forceProxy", forceProxy); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
SendSafelyAPI/src/com/sendsafely/dto/request/GetDownloadUrlsRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.sendsafely.dto.request; | ||
|
||
import com.sendsafely.enums.GetParam; | ||
import com.sendsafely.enums.HTTPMethod; | ||
import com.sendsafely.json.JsonManager; | ||
|
||
public class GetDownloadUrlsRequest extends BaseRequest { | ||
|
||
private HTTPMethod method = HTTPMethod.POST; | ||
private String path = "/package/" + GetParam.PACKAGE_ID + "/file/" + GetParam.FILE_ID + "/download-urls/"; | ||
|
||
public GetDownloadUrlsRequest(JsonManager jsonManager){ | ||
initialize(jsonManager, method, path); | ||
} | ||
|
||
public void setPackageId(String packageId) { | ||
super.setGetParam(GetParam.PACKAGE_ID, packageId); | ||
} | ||
|
||
public void setFileId(String fileId) { | ||
super.setGetParam(GetParam.FILE_ID, fileId); | ||
} | ||
|
||
public void setStartSegment(int start) { | ||
super.setPostParam("startSegment", start); | ||
} | ||
|
||
public void setEndSegment(int end) { | ||
super.setPostParam("endSegment", end); | ||
} | ||
|
||
public void setChecksum(String checksum){ | ||
super.setPostParam("checksum", checksum); | ||
} | ||
public void setForceProxy(boolean forceProxy){ | ||
super.setPostParam("forceProxy", forceProxy); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
SendSafelyAPI/src/com/sendsafely/dto/response/GetDownloadUrlsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.sendsafely.dto.response; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class GetDownloadUrlsResponse extends BaseResponse { | ||
|
||
private List<Map<String, String>> downloadUrls; | ||
|
||
public List<Map<String, String>> getDownloadUrls() { | ||
return downloadUrls; | ||
} | ||
|
||
public void setDownloadUrls(List<Map<String, String>> downloadUrls) { | ||
this.downloadUrls = downloadUrls; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
SendSafelyAPI/src/com/sendsafely/exceptions/GetDownloadUrlsException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.sendsafely.exceptions; | ||
|
||
public class GetDownloadUrlsException extends Exception { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
String error; | ||
|
||
public GetDownloadUrlsException(Exception e) { | ||
super(e); | ||
error = e.getMessage(); | ||
} | ||
|
||
public GetDownloadUrlsException(String err){ | ||
super(err); | ||
error = err; | ||
} | ||
|
||
} |
Oops, something went wrong.