-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make display ocfl path configurable and add tests
- Loading branch information
Showing
5 changed files
with
323 additions
and
7 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
fcrepo-configs/src/main/java/org/fcrepo/config/DisplayOcflPath.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,40 @@ | ||
/* | ||
* The contents of this file are subject to the license and copyright | ||
* detailed in the LICENSE and NOTICE files at the root of the source | ||
* tree. | ||
*/ | ||
package org.fcrepo.config; | ||
|
||
/** | ||
* Display OCFL path mode enum | ||
* @author whikloj | ||
*/ | ||
public enum DisplayOcflPath { | ||
NONE("none"), | ||
RELATIVE("relative"), | ||
ABSOLUTE("absolute"); | ||
|
||
private final String value; | ||
|
||
DisplayOcflPath(final String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public static DisplayOcflPath fromString(final String value) { | ||
for (final var mode : values()) { | ||
if (mode.value.equalsIgnoreCase(value)) { | ||
return mode; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unknown display OCFL path mode: " + value); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return value; | ||
} | ||
} |
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
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
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
Oops, something went wrong.