IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6625


Ignore:
Timestamp:
Mar 16, 2006, 5:40:46 PM (20 years ago)
Author:
jhoblitt
Message:

make fileid, bytes, md5sum, & type params to ->new() optional
remove filename param writable test from ->request()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/lib/DataStore/File.pm

    r6615 r6625  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: File.pm,v 1.9 2006-03-17 01:11:23 jhoblitt Exp $
     3# $Id: File.pm,v 1.10 2006-03-17 03:40:46 jhoblitt Exp $
    44
    55package DataStore::File;
     
    1818use Digest::MD5::File qw( file_md5_hex );
    1919use File::stat;
    20 use POSIX ();
    2120use Params::Validate qw( validate SCALAR );
    2221
     
    128127                type        => SCALAR,
    129128                regex       => $STD_FIELD,
     129                optional    => 1,
    130130            },
    131131            bytes   => {
    132132                type        => SCALAR,
    133133                regex       => $BYTE_FIELD,
     134                optional    => 1,
    134135            },
    135136            md5sum  => {
    136137                type        => SCALAR,
    137138                regex       => $MD5_FIELD,
     139                optional    => 1,
    138140            },
    139141            type    => {
     
    143145                        sub { exists $KNOWN_FILE_TYPES{$_[0]} },
    144146                },
     147                optional    => 1,
    145148            },
    146149        },
     
    181184object.
    182185
    183 XXX writing the file into memory or to a filehandle will be implimented upon
     186XXX writing the file into memory or to a filehandle will be implemented upon
    184187request.
    185188
     
    192195=item * filename
    193196
    194 The filename/path to save the file to disk as.
     197The filename/path to save the file to disk as.  It is the user's responsibility
     198to make sure that this is a valid filename/path.
    195199
    196200=back
     
    206210            filename    => {
    207211                type        => SCALAR,
    208                 regex       => qr/\S+/, # string with atleast 1 non WS char
    209                 callbacks   => {
    210                     'write access' => sub {
    211                         POSIX::access($_[0], &POSIX::W_OK);
    212                     },
    213                 },
     212                regex       => qr/\S+/, # string with at least 1 non WS char
    214213            },
    215214        },
Note: See TracChangeset for help on using the changeset viewer.