NAME
Pinto::Role::FileFetcher - Something that fetches remote files
VERSION
version 0.080
METHODS
fetch(from => 'http://someplace' to => 'some/path')
Fetches the file located at from
to the file located at to
, if the file at from
is newer than the file at to
. If the intervening directories do not exist, they will be created for you. Returns a true value if the file has changed, returns false if it has not changed. Throws and exception if anything goes wrong.
The to
argument can be either a URI or Path::Class::File object, or a string that represents either of those. The from
attribute can be a Path::Class::File object or a string that represents one.
fetch_temporary(url => 'http://someplace')
Fetches the file located at the url
to a file in a temporary directory. The file will have the same basename as the url
. Returns a Path::Class::File that points to the new file. Throws and exception if anything goes wrong. Note the temporary directory and all its contents will be deleted when the process terminates.
CONTRIBUTORS
Cory G Watson <gphat@onemogin.com>
Jakob Voss <jakob@nichtich.de>
Jeff <jeff@callahan.local>
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
Jeffrey Thalhammer <jeff@imaginative-software.com>
Karen Etheridge <ether@cpan.org>
Michael G. Schwern <schwern@pobox.com>
Steffen Schwigon <ss5@renormalist.net>
Wolfgang Kinkeldei <wolfgang@kinkeldei.de>
Yanick Champoux <yanick@babyl.dyndns.org>
AUTHOR
Jeffrey Ryan Thalhammer <jeff@stratopan.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jeffrey Ryan Thalhammer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.