NAME

Catalyst::Controller::SimpleCAS::Store::File - Standard file-based Store for SimpleCAS

SYNOPSIS

 use Catalyst::Controller::SimpleCAS;
 ...

DESCRIPTION

This is the main "Store" object class used by Catalyst::Controller::SimpleCAS for persisting/storing arbitrary pieces of content on disk according to their CAS (content-addressed storage) name/address, in this case, standard 40 character SHA1 hex strings (160-bit). This is the same thing that Git does, which was the original inspiration for the SimpleCAS module.

Currently, this is the only Store class, but others could be implemented and the system was designed with this in mind (i.e. a DBIC-based store). Also, the implementation need not use the 40-char sha1 addresses - any content/checksum system for IDs could be implemented.

Also note that an actual Git-based store was partially written, but never finished. See the branch named partial_git_store in the GitHub repository for more info.

This class is used internally and should not need to be called directly.

ATTRIBUTES

store_dir

Where to store the data. This is the only required option and is a pass-through from the option of the same name in Catalyst::Controller::SimpleCAS.

METHODS

add_content

add_content_base64

add_content_file

add_content_file_mv

calculate_checksum

checksum_to_path

content_exists

content_mimetype

content_size

fetch_content

fetch_content_fh

file_checksum

image_size

init_store_dir

split_checksum

SEE ALSO

AUTHOR

Henry Van Styn <vanstyn@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by IntelliTree Solutions llc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.