Closed yagee-de closed 3 years ago
How about I modify the FileDetails object that's returned as part of a describeObject
/describeVersion
request to include the path to the file relative to the storage root?
For example, let's you have object obj123
and v1 of the object contains the file dir1/file1.mov
. The FileDetails
object in this case would look something like the following:
{
"filePath": "dir1/file1.mov",
"storagePath": "obj123/v1/content/dir1/file1.mov",
"fixity": {
"sha512": "..."
}
}
Would that work for you?
Hi this sounds like a way to go, but I need to get the storage path of obj123
via ObjectDetails and/or via OcflRepository. In the end I need an absolute path to serve the content, so handling with the triple of OcflRepository
, ObjectDetails
and FileDetails
could make the code ugly. Maybe all three could implement an Interface e.g. PathResolveable
with two methods Path getRelativePath()
and Path getAbsolutePath()
?
I cannot add absolute paths to the API because this does not make sense for all implementations, such as the Amazon S3 implementation that I recently started working on.
Just so I'm sure we're on the same page, there are three paths of interest.
ocfl-java
library, this path is dictated by the ObjectIdPathMapper
that is used.In the FileDetails
solution that I purposed, storagePath
is the equivalent of objectRootPath
/filePath
. That is to say, it is the path to a file within an object relative to the storage root. (As an aside, this value is also the key that the file is stored under in S3.) All your code would need to do is resolve the storagePath
with the path to the storage root.
Commit 6144f4fe1b7f117dfecaa2744115ae9535de1c8d adds storagePath
to FileDetails.
I'm going to close this issue. ocfl-java
does support retrieving files via InputStream
. Feel free to re-open if you have more to say.
For large video or PDF files I need to response to range requests. OcflObjectReader should allow access to physical Path on the underlying filesystem to allow efficient handling of those requests.