NAME
LCC::Documents::filesystem - Documents stored on a filesystem
SYNOPSIS
use LCC;
$lcc = LCC->new( | {method => value} );
$lcc->Documents( '/dir', | {method => value} ); # figures out it's filesystem
$lcc->Documents( 'filesystem','/dir', | {method => value} ); # force filesystem
DESCRIPTION
The Documents object of the Perl support for LCC that should be used when documents are stored as files on a filesystem. Do not create directly, but through the Documents method of the LCC object.
Uses the File::Find module to create a list of files.
METHODS
Apart from the methods documented here, see the methods available in the LCC::Documents module.
file_find_options
$lcc->Documents( '/dir', {file_find_options => {bydepth => 1}} );
Specify (and/or return) the reference to the hash that is passed as the first parameter to File::Find::find. For more information, check the documentation of the File::Find module.
mimetype
$lcc->Documents( '/dir', {mimetype => \&mymimetype} );
Specify (and/or return) the reference of the subroutine that will be called to find out the MIME-type of each file that is being checked. Is expected to accept a single parameter, the absolute filename of the file being checked. Is expected to return the MIME-type to be associated with the file, or undef.
A default "mimetype" routine will be assumed that will return the correct MIME-type for all of the filetypes that are accepted by the default wanted subroutine.
subtype
$lcc->Documents( '/dir', {subtype => \&mysubtype} );
Specify (and/or return) the reference of the subroutine that will be called to find out the subtype of each file that is being checked. Is expected to accept a single parameter, the absolute filename of the file being checked. Is expected to return the subtype to be associated with the file, or undef.
A default "subtype" routine will be assumed that will always return an empty string.
wanted
$lcc->Documents( '/dir', {wanted => \&mywanted} );
Specify (and/or return) the reference of the subroutine that will be called for each file encountered. Is expected to accept a single parameter, the absolute filename of the file being checked. Is also expected to return a true value if the file should be included in the check.
A default "wanted" subroutine will be assumed if this method is never called. This subroutine checks whether the file as any of the following extensions:
.doc
.htm
.html
.pdf
.php
.phtml
.shtml
.text
.txt
.xls
.xml
.xsl
and returns true (to indicate the file should be included in the check) if the extension matches.
AUTHOR
Elizabeth Mattijsen, <liz@dijkmat.nl>.
Please report bugs to <perlbugs@dijkmat.nl>.
COPYRIGHT
Copyright (c) 2002 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
http://lococa.sourceforge.net, the LCC.pm and the other LCC::xxx modules.