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

change prefix for checking if local available file


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 8773970d
Pipeline #20148 failed with stages
in 3 minutes and 41 seconds
......@@ -56,9 +56,9 @@ trait RecordUtils {
}
}
protected def isLocalRecord(obj: ujson.Obj, externalBaseUrl: String): Boolean = {
protected def isLocalRecord(obj: ujson.Obj, sftpPrefix: String = "sftp:/"): Boolean = {
hasKeyValue(obj, "locator") {
value => value.startsWith(externalBaseUrl)
value => value.startsWith(sftpPrefix)
}
}
......
......@@ -83,7 +83,7 @@ object BinaryResourceMetadata extends RecordUtils {
val id = v.obj.getOrElse("@id", Value("<unknown id>")).str
Try(
v.obj match {
case v if isLocalRecord(v, baseUrl) && isProcessableMimeType(v) =>
case v if isLocalRecord(v) && isProcessableMimeType(v) =>
getEventType(jsonldGraph) match {
case Some(UnknownEvent(e)) => throw new UnknownEventType(s"Event type `$e` for $id not known")
case Some(eventType) =>
......@@ -100,7 +100,7 @@ object BinaryResourceMetadata extends RecordUtils {
eventType)
case None => throw new NoEventType(id)
}
case v if isLocalRecord(v, baseUrl) =>
case v if isLocalRecord(v) =>
val resource = MemobaseResource(v("type").str)
throw new UnmanageableMediaFileType(s"Media file type for $id unknown", resource)
case v =>
......
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