Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit caccdc4

Browse files
author
sowerstl
committed
Add .tgz upload support; (DOECODE-666)
1 parent 5d721ac commit caccdc4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/gov/osti/services/Metadata.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,10 +950,10 @@ private static void validateUploads(FormDataContentDisposition fileInfo, FormDat
950950
// evaluate file upload
951951
if (fileInfo != null && !StringUtils.isBlank(fileInfo.getFileName())) {
952952
String fileName = fileInfo.getFileName();
953-
Pattern filePattern = Pattern.compile("[.](?:zip|tar(?:[.](?:gz|bz2))?)$");
953+
Pattern filePattern = Pattern.compile("[.](?:zip|tgz|tar(?:[.](?:gz|bz2))?)$");
954954
Matcher m = filePattern.matcher(fileName);
955955
if (!m.find())
956-
throw new ValidationException("File upload failed! File must be of type: .zip, .tar, .tar.gz, .tar.bz2");
956+
throw new ValidationException("File upload failed! File must be of type: .zip, .tar, .tgz, .tar.gz, .tar.bz2");
957957
}
958958

959959
// evaluate container upload

src/main/java/gov/osti/services/Metadata.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Send JSON metadata to be persisted in the back-end. This service persists the d
208208
> ```
209209
210210
<p id='metadata-save-upload-via-api'>
211-
*When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
211+
*When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tgz, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
212212
</p>
213213
214214
### submit
@@ -273,7 +273,7 @@ Validation rules are:
273273
* software type is required:
274274
* "S" (Scientific)
275275
* "B" (Business), also requires at least one sponsoring organization
276-
* If project type is Closed Source, OSTI Hosted ("CO"), a file upload is required. *When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
276+
* If project type is Closed Source, OSTI Hosted ("CO"), a file upload is required. *When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tgz, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
277277
278278
279279
@@ -333,7 +333,7 @@ be announced to DOE. Workflow status remains *Submitted* for this operation. Ad
333333
* email must be valid
334334
* phone number must be valid
335335
* organization name is required
336-
* If project type is not Open Source ("OS"), a file upload is required. *When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
336+
* If project type is not Open Source ("OS"), a file upload is required. *When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tgz, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
337337
338338
339339

0 commit comments

Comments
 (0)