NAME

Store::Digest::Object - One distinct Store::Digest data object

VERSION

Version 0.01

SYNOPSIS

my $dataobj = $store->get('sha-256' => $key);

my $fh = $dataobj->content;

METHODS

This class exists to encapsulate the metadata relevant to a Store::Digest data object. It is not instantiated directly. All methods are read-only accessors.

content

Returns a filehandle or equivalent, pointing to the object's content, open in read-only mode. Unless the object has been deleted, then this will be undef.

digest

my $uri = $dataobj->digest('sha-1');

my @algos = $dataobj->digest;

Returns a URI::di object for the relevant digest algorithm. Will croak if an invalid digest algorithm is supplied. While valid digest algorithms are specified at creation time, you can retrieve them by calling this method with no arguments.

size

Returns the byte size of the object. Note that for deleted objects, this will be whatever the size of the object was before it was deleted.

type

Returns the MIME type

charset

Returns the character set (e.g. utf-8) of the data object if known.

language

Returns the natural language in RFC 5646 format, if it was supplied.

encoding

Returns the transfer encoding, of the data object if known, (e.g. gzip or deflate, not the "charset").

ctime

Returns the timestamp at which the object was added to the store, from the point of view of the system.

mtime

Returns the timestamp that was supplied as the modification time of the object from the point of view of the user, if different from "ctime".

ptime

Returns the timestamp of the time the metadata properties of the object were last updated.

dtime

Returns the system timestamp at which the object was deleted, if applicable.

type_checked

This flag represents that the claimed content-type has been checked.

type_valid

charset_checked

charset_valid

encoding_checked

encoding_valid

syntax_checked

This flag represents an additional layer of syntax checking, e.g. XML validation.

syntax_valid

matches $DIGEST

Pass in a URI::ni object or string representing a RFC6920 named identifier, and this method will tell you you whether or not the object possesses a matching digest.

as_string

AUTHOR

Dorian Taylor, <dorian at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2012 Dorian Taylor.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.