NAME
Footprintless::ResourceManager - A manager for finding and retrieving resources
VERSION
version 1.20
SYNOPSIS
use Footprintless;
my $footprintless = Footprintless->new();
my $resource_manager = footprintless->resource_manager();
# Find a resource
my $resource = $resource_manager->resource('/foo/bar');
# Download it
my $file = $resource->download();
# Download a maven resource (without resolving first)
my $file = $resource_manager->download('com.pastdev:foo:1.0.0');
# Download a resource to a specific location
$resource_manager->download(
'http://pastdev.com/resources/baz',
to => '/foo/baz');
DESCRIPTION
Manages finding and retrieving resources.
CONSTRUCTORS
new(@providers)
Constructs a Footprintless::ResourceManager
that will locate resources using the supplied providers. Each provider will by queried, in order, with a call to supports($spec). The first to respond with a truthy value will be used.
METHODS
download($resource, %options)
Downloads $resource
, and returns the path that it was downloaded to. The supported options are:
- to
-
The path to download to. If the path points to an existing directory, then the resource will be downloaded into that directory and maintain its name part from the URL. Otherwise, the path will be used for the file.
resource($spec)
Returns the Footprintless::Resource indicated by $spec
.
AUTHOR
Lucas Theisen <lucastheisen@pastdev.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Lucas Theisen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
SEE ALSO
Please see those modules/websites for more information related to this module.