NAME

Nuvol::Drive - Container for cloud drives

SYNOPSIS

    use Nuvol;
    my $connector = Nuvol::connect($configfile);
    my $drive     = $connector->drive($path);

    use Nuvol::Drive;
    my $drive = Nuvol::Drive->new($connector, $params);
 
    $drive->connector;
    $drive->item;

    # metadata
    $drive->description;
    $drive->id;
    $drive->metadata;
    $drive->name;

DESCRIPTION

Nuvol::Drive is a container for cloud drives. The constructor automatically activated the appropriate service, which is one of Nuvol::Dummy::Drive, Nuvol::Office365::Drive.

CONSTRUCTOR

via Nuvol

    use Nuvol;
    $connector = Nuvol::connect($configfile);

    $drive = $connector->drive($path);
    $drive = $connector->drives->first;

In daily use a Nuvol::Drive is created with "drive" in Nuvol::Connector or "drives" in Nuvol::Connector.

new

    $drive = Nuvol::Drive->new($connector, {id       => $id});
    $drive = Nuvol::Drive->new($connector, {metadata => $metadata});
    $drive = Nuvol::Drive->new($connector, {path     => $path});

The constructor is called internally and can be used when the metadata or id of the drive are known.

METHODS

Nuvol::Connector inherits the following methods from Nuvol::Role::Metadata:

description
id
metadata
name
url

connector

    $connector = $drive->connector;

Getter for the connector. Returns a Nuvol::Connector.

item

    $item = $drive->item($path);
  

Getter for an item with the specified path. Returns a Nuvol::Item.

    $file   = $drive->item('/path/to/file');
    $folder = $drive->item('/path/to/folder/');

Paths must be absolute (starting with a slash). Paths with trailing slash are interpreted as folders, without slash as files.

SEE ALSO

Nuvol::Connector, Nuvol::Item, Nuvol::Role::File, Nuvol::Role::Folder.