Unverified Commit f348e4d1 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

remove postfix in id of digital object


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 1938c9ca
Pipeline #20172 passed with stages
in 8 minutes and 17 seconds
......@@ -19,6 +19,7 @@
package ch.memobase
import org.apache.logging.log4j.scala.Logging
import org.memobase.fedora.{FedoraClient, FedoraClientImpl}
import java.io.ByteArrayOutputStream
......@@ -33,7 +34,7 @@ import scala.util.Try
*
* @param fc Wrapped [[org.memobase.fedora.FedoraClient]] instance
*/
class FedoraClientWrapper(fc: FedoraClient) {
class FedoraClientWrapper(fc: FedoraClient) extends Logging {
import FedoraClientWrapper.copyDataAndCloseResource
......@@ -44,6 +45,7 @@ class FedoraClientWrapper(fc: FedoraClient) {
* @return
*/
def fetchBinaryResource(url: String): Try[ByteArrayOutputStream] = {
logger.info(s"Try fetching from $url")
for {
u <- Try(new URL(url))
ip <- Try(io.Source.fromURL(u))
......
......@@ -58,7 +58,7 @@ object BinaryResourceMetadata extends RecordUtils {
}
private def buildDistributorUrl(longId: String, baseUrl: String, distributorHost: String, resourceType: MemobaseResource): String = {
val pattern = raw"""$baseUrl/digital/([^/]+).*""".r
val pattern = raw"""$baseUrl/digital/([^/]+)-1""".r
pattern.findFirstMatchIn(longId) match {
case Some(m) =>
resourceType match {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment