-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bxc 4355 update download image (#1637)
* BXC-4355 update full to max for iiifv3 * BXC-4355 clean up code and add util class * BXC-4355 replace bean --------- Co-authored-by: Sharon Luong <[email protected]>
- Loading branch information
1 parent
8be5fb0
commit bdd46e2
Showing
6 changed files
with
46 additions
and
33 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
web-services-app/src/main/java/edu/unc/lib/boxc/web/services/utils/ImageServerUtil.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,22 @@ | ||
package edu.unc.lib.boxc.web.services.utils; | ||
|
||
import java.net.URLEncoder; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import static edu.unc.lib.boxc.model.fcrepo.ids.RepositoryPaths.idToPath; | ||
|
||
/** | ||
* @author snluong | ||
*/ | ||
public class ImageServerUtil { | ||
/** | ||
* Returns the object ID in proper encoded format with .jp2 extension | ||
* @param id | ||
* @return | ||
*/ | ||
public static String getImageServerEncodedId(String id) { | ||
var idPathEncoded = URLEncoder.encode(idToPath(id, 4, 2), StandardCharsets.UTF_8); | ||
var idEncoded = URLEncoder.encode(id, StandardCharsets.UTF_8); | ||
return idPathEncoded + idEncoded + ".jp2"; | ||
} | ||
} |
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