package Cantella::Store::UUID::File;
use Moose;
use JSON ();
use File::MimeInfo::Magic ();
use MooseX::Types::Data::GUID qw/GUID/;
use MooseX::Types::Path::Class qw/Dir File/;
use namespace::autocl
{
my $self = shift;
my $file = $self->_meta_file;
if( my $json = $file->slurp ){
if( my $perl = eval { JSON::from_json( $json ) }){
return $perl;
}
die("Failed to parse conten
(my $json = JSON::to_json( $self->metadata || {} ) ){
if( my $fh = $file->openw ){
print $fh $json;
return 1;
}
die("Failed to write meta file '${file}' Contents: '${json}': $