I do believe that the "CBLDatabase+Attachments.h" where the
digest:toBlobKey method resides is private.
And so is CBLBlobKey I believe.
On Thursday, March 31, 2016 at 2:26:56 AM UTC-6, Brendan Duddridge wrote:
>
> Hi,
>
> I'm writing an export routine which generates a big JSON file. I need to
> extract file attachments from the database now and store them into a folder
> along side the JSON file. Is there a way to get access to the following
> method?
>
> + (bool) digest: (NSString*)digest toBlobKey: (CBLBlobKey*)outKey;
>
> I'm assuming that is will take the digest as provided by the metadata from
> the CBLAttachment and give me a filename that I can read from? I don't want
> to store the files with the original filename because I might have file
> attachments from different documents with the same attachment name, but are
> actually different files.
>
> So I thought I would do something similar to what CBL already does with
> naming attachments. But since the data I have in the JSON file is whatever
> the CBLAttachment metadata is, I would like to figure out how to name the
> attachments correctly so that when I import the JSON file I'm able to
> determine from the digest what attachment file to read in.
>
> Here's an example of what my attachments JSON looks like:
>
> "_attachments": {
> "icon": {
> "stub": true,
> "length": 6411,
> "digest": "sha1-/wxjDAVSpOaf7qN7SWuqNZ4IM78=",
> "revpos": 1,
> "content_type": "image/png"
> }
> }
>
> "icon" is just the name I give an icon that I associate with one of my
> model objects. But it could be a regular file name such as
> "hunger-games.jpg" or "terminator.png", etc.
>
> Thanks,
>
> Brendan
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/fd7d80f3-b634-46e0-875b-47483039fddf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.