Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
janvanmansum committed Dec 6, 2024
1 parent d7a4352 commit dedcb56
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ editFiles:
categories: [ 'Testlabel' ]
ignoreFiles:
- 'file7.txt' # This file will NOT be added to the dataset
renameAtUploadFiles:
- from: 'file8.txt' # Local file name
to: 'file9.txt' # The file name assigned in the dataset
autoRenameFiles:
- from: "Unsanitize'd/file?" # Local file name
to: "Sanitize_d/file_" # The file name assigned in the dataset
addEmbargoes:
- filePaths: [ 'file1.txt' ] # All other files will NOT be embargoed
dateAvailable: '2030-01-01'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public FilesEditor(@NonNull UUID depositId, @NonNull Path dataDir, @NonNull Edit
this.editFiles = editFiles;
this.dataverseService = dataverseService;
this.utilityServices = utilityServices;
this.filesInDatasetCache = new FilesInDatasetCache(dataverseService, getRenameMap(editFiles.getRenameAtUploadFiles()));
this.filesInDatasetCache = new FilesInDatasetCache(dataverseService, getRenameMap(editFiles.getAutoRenameFiles()));
}

private static Map<String, String> getRenameMap(List<FromTo> renames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public EditFiles getEditFilesFromDansDeposit(Deposit dansDeposit) {

pathFileInfoMap = removeIgnoredFiles(pathFileInfoMap, ignoredFiles);

editFiles.setRenameAtUploadFiles(getRenameAtUpload(pathFileInfoMap));
editFiles.setAutoRenameFiles(getRenameAtUpload(pathFileInfoMap));

editFiles.setAddRestrictedFiles(pathFileInfoMap.entrySet().stream()
.filter(entry -> entry.getValue().getMetadata().getRestricted())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class EditFiles {
private List<String> addRestrictedFiles = List.of();
private List<FromTo> moveFiles = List.of();
private List<String> ignoreFiles = List.of();
private List<FromTo> renameAtUploadFiles = List.of();
private List<FromTo> autoRenameFiles = List.of();
private List<FileMeta> updateFileMetas = List.of();
private List<AddEmbargo> addEmbargoes = List.of();
}

0 comments on commit dedcb56

Please sign in to comment.