@@ -121,13 +121,15 @@ public java.io.File makeRequestS3(String packageId, String directoryId, String f
121
121
// Download the file
122
122
java .io .File file = null ;
123
123
try {
124
- file = downloadFileFromS3 (systemFile , fileToDownload , forceProxy );
124
+ file = downloadFileS3 (systemFile , fileToDownload , password , forceProxy , 0 );
125
125
} catch (GetDownloadUrlsException e ) {
126
- throw new DownloadFileException ("Unable to get download URLs" );
126
+ throw new DownloadFileException (e . getMessage () );
127
127
} catch (LimitExceededException e ){
128
128
try {
129
- file = downloadFileFromS3 (systemFile , fileToDownload , true , Integer .parseInt (e .getMessage ().toString ()));
130
- } catch (GetDownloadUrlsException | LimitExceededException e1 ) {
129
+ file = downloadFileS3 (systemFile , fileToDownload , password , true , Integer .parseInt (e .getMessage ().toString ()));
130
+ } catch (GetDownloadUrlsException e1 ) {
131
+ throw new DownloadFileException (e .getMessage ());
132
+ } catch (LimitExceededException e1 ) {
131
133
throw new DownloadFileException ("Unable to get download URLs" );
132
134
}
133
135
}catch (Exception e ){
@@ -232,11 +234,7 @@ private java.io.File downloadFile(java.io.File outFile, File ssFile) throws Down
232
234
return outFile ;
233
235
}
234
236
235
- private java .io .File downloadFileFromS3 (java .io .File systemFile , File fileToDownload , boolean forceProxy ) throws DownloadFileException , PasswordRequiredException , GetDownloadUrlsException , LimitExceededException {
236
- return downloadFileFromS3 (systemFile , fileToDownload , forceProxy , 0 );
237
- }
238
-
239
- private java .io .File downloadFileFromS3 (java .io .File outFile , File ssFile , boolean forceProxy , int filePart ) throws DownloadFileException , PasswordRequiredException , GetDownloadUrlsException , LimitExceededException {
237
+ private java .io .File downloadFileS3 (java .io .File outFile , File ssFile , String password , boolean forceProxy , int filePart ) throws DownloadFileException , PasswordRequiredException , GetDownloadUrlsException , LimitExceededException {
240
238
241
239
Progress progress = new Progress (this .progress , ssFile .getFileId ());
242
240
progress .setTotal (ssFile .getFileSize ());
@@ -256,7 +254,7 @@ private java.io.File downloadFileFromS3(java.io.File outFile, File ssFile, boole
256
254
257
255
GetDownloadUrlsHandler urlHandler = new GetDownloadUrlsHandler (uploadManager ,ssFile .getParts ());
258
256
String checksum = calculateChecksum (packageInfo .getPackageCode (), packageInfo .getKeyCode ());
259
- urlHandler .fetchDownloadUrls (packageInfo .getPackageId (), ssFile .getFileId (), this .directoryId , part , forceProxy , checksum );//do we need password here?
257
+ urlHandler .fetchDownloadUrls (packageInfo .getPackageId (), ssFile .getFileId (), this .directoryId , part , forceProxy , password , checksum );
260
258
261
259
while (!urlHandler .getCurrentDownloadUrls ().isEmpty ()) {
262
260
@@ -309,7 +307,7 @@ private java.io.File downloadFileFromS3(java.io.File outFile, File ssFile, boole
309
307
}
310
308
urlHandler .removeUrl ();
311
309
part ++;
312
- urlHandler .fetchDownloadUrls (packageInfo .getPackageId (), ssFile .getFileId (), this .directoryId , part , forceProxy , checksum );
310
+ urlHandler .fetchDownloadUrls (packageInfo .getPackageId (), ssFile .getFileId (), this .directoryId , part , forceProxy , password , checksum );
313
311
}
314
312
}catch (LimitExceededException e ){
315
313
throw new LimitExceededException (e .getMessage ());
0 commit comments