Catmandu::Store::File::MediaHaven::Index - Index of all "Folders" in a MediaHaven database
use Catmandu; my $store = Catmandu->store('File::MediaHaven' , url => '...' , username => '...' , password => '...' , ); my $index = $store->index; # List all containers $index->each(sub { my $container = shift; print "%s\n" , $container->{_id}; }); # Get a folder my $folder = $index->get(1234); # Get the files in an folder my $files = $index->files(1234); $files->each(sub { my $file = shift; my $name = $file->_id; my $size = $file->size; my $content_type = $file->content_type; my $created = $file->created; my $modified = $file->modified; $file->stream(IO::File->new(">/tmp/$name"), file); }); # Retrieve a file my $file = $files->get("data.dat"); # Stream a file to an IO::Handle $files->stream(IO::File->new(">data.dat"),$file);
This Catmandu::Bag implements:
To install Catmandu::MediaHaven, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::MediaHaven
CPAN shell
perl -MCPAN -e shell install Catmandu::MediaHaven
For more information on module installation, please visit the detailed CPAN module installation guide.