Skip to content

Commit ab96ab6

Browse files
committed
Fixed null pointer on swift folder path separator
1 parent 2422349 commit ab96ab6

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

doc/sphinx-guides/source/installation/config.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,7 @@ Then run the create command:
222222

223223
``./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.files.storage-driver-id=swift"``
224224

225-
You also have the option to set a custom container name separator. It is initialized to ``_``, so you must first run the delete command:
226-
227-
``./asadmin $ASADMIN_OPTS delete-jvm-options "\-Ddataverse.files.swift-folder-path-separator=_"``
228-
229-
And then run the create command:
225+
You also have the option to set a custom container name separator. It is initialized to ``_``, but you can change it by running the create command:
230226

231227
``./asadmin $ASADMIN_OPTS create-jvm-options "\-Ddataverse.files.swift-folder-path-separator=-"``
232228

src/main/java/edu/harvard/iq/dataverse/dataaccess/SwiftAccessIO.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,9 @@ private String getSwiftFileURI(StoredObject fileObject) throws IOException {
666666

667667
public String getSwiftContainerName() {
668668
String swiftFolderPathSeparator = System.getProperty("dataverse.files.swift-folder-path-separator");
669+
if (swiftFolderPathSeparator == null) {
670+
swiftFolderPathSeparator = "_";
671+
}
669672
String authorityNoSlashes = this.getDataFile().getOwner().getAuthority().replace(this.getDataFile().getOwner().getDoiSeparator(), swiftFolderPathSeparator);
670673
String containerName = this.getDataFile().getOwner().getProtocol() + swiftFolderPathSeparator +
671674
authorityNoSlashes.replace(".", swiftFolderPathSeparator) +

0 commit comments

Comments
 (0)