Acquire.Storage._fileinfo module

class FileInfo(drive_uid=None, filehandle=None, identifiers=None, upstream=None)[source]

Bases: object

This class provides information about a user-file that has been uploaded to the storage service. This includes all versions of the file, the ACLs for different users etc.

Just as Acquire.Client.Drive provides the client-side view of Acquire.Storage.DriveInfo, so to does Acquire.Client.FileHandle provide the client-side view of Acquire.Storage.FileInfo

aclrules(version=None)[source]

Return the ACL rules for the specified user, or if that is not specified, the ACL rules for the current version

checksum(version=None)[source]

Return the checksum of the latest (or specified) version of this file

compression_type(version=None)[source]

Return the compression type (or None if not compressed) of the latest (or specified) version of this file

drive()[source]

Return the actual DriveInfo object for the drive on which this file resides

drive_uid()[source]

Return the UID of the drive on which this file resides

file_uid(version=None)[source]

Return the UID of the latest (or specified) version of this file

filename()[source]

Return the object-store filename for this file

filesize(version=None)[source]

Return the size (in bytes) of the latest (or specified) version of this file

static from_data(data, identifiers=None, upstream=None)[source]

Return this object constructed from the passed json-deserialised dictionary. If ‘identifier’ and ‘upstream’ are passed then these set the user identifiers and upstream ACL of the file object as it was opened.

get_filemeta(version=None)[source]

Return the metadata about the latest (or specified) version of this file. If ‘resolved_acl’ is specified, then return the

is_compressed(version=None)[source]

Return whether or not the latest (or specified) version of this file is stored and transmitted in a compressed state

is_null()[source]

Return whether or not this is null

latest_version()[source]

Return the latest version of this file on the storage service. This is a datetime of the upload of the latest version. You will need to use the ‘versions’ function to find if there are other versions.

static list_versions(drive, filename, identifiers=None, upstream=None, include_metadata=False)[source]

List all of the versions of this file. If ‘include_metadata’ is True then this will load all of the associated metadata for each file

static load(drive, filename, version=None, identifiers=None, upstream=None)[source]

Load and return the FileInfo for the file called ‘filename’ on the passed ‘drive’.

save()[source]

Save this fileinfo to the object store

to_data()[source]

Return a json-serialisable dictionary for this object

version(version)[source]

Return the version at the specified datetime

versions()[source]

Return the sorted list of all versions of this file on the storage service

class VersionInfo(filesize=None, checksum=None, aclrules=None, compression=None, identifiers=None)[source]

Bases: object

This class holds specific info about a version of a file

aclrules()[source]

Return all of the ACL rules for this version of the file

checksum()[source]

Return the checksum for this version of the file

compression_type()[source]

Return the type of compression used if this file is stored and transmitted in a compressed state, or None if this is not compressed

datetime()[source]

Return the datetime when this version was created

filesize()[source]

Return the size in bytes of this version of the file

static from_data(data)[source]

Return this object constructed from the passed json-deserialised dictionary

is_compressed()[source]

Return whether or not this file is stored and transmitted in a compressed state

is_null()[source]

Return whether or not this is null

to_data()[source]

Return a json-serialisable dictionary for this object

uid()[source]

Return the UID of this version of the file in object store

uploaded_by()[source]

Return the GUID of the user that uploaded this version