Acquire.Storage._filemeta module

class FileMeta(filename=None, uid=None, filesize=None, checksum=None, uploaded_by=None, uploaded_when=None, compression=None, aclrules=None)[source]

Bases: object

This is a lightweight class that holds the metadata about a particular version of a file

acl()[source]

If known, return the ACL for this version of the file for the user that requested this FileMeta (e.g. the user who listed the drive containing this file)

aclrules()[source]

If known, return the ACL rules that were used to generate the ACL for this file. Note that you can only see the ACL rules if you are an owner of the file

assert_correct_data(filedata=None, filename=None)[source]

Assert that the passed data is correct (right size and checksum)

checksum()[source]

If known, return a checksum of the file

compression_type()[source]

Return the compression type for this file, if it is stored and transmitted in a compressed state

filename()[source]

Return the name of the file

filesize()[source]

If known, return the size of the file

static from_data(data)[source]

Return a new FileMeta constructed from the passed json-deserialised dictionary

has_metadata()[source]

Return whether or not this file includes all of the metadata. If not, then only the filename is available

is_compressed()[source]

If known, return whether or not this file is stored and transmitted in a compressed state

is_null()[source]

Return whether or not this is null

resolve_acl(**kwargs)[source]

Resolve the ACL for this file based on the passed arguments (same as for ACLRules.resolve()). This returns the resolved ACL, which is set as self.acl()

to_data()[source]

Return a json-serialisable dictionary of this object

uid()[source]

Return the UID of the file in the system

uploaded_by()[source]

If known, return the GUID of the user who uploaded this version of the file

uploaded_when()[source]

If known, return the datetime when this version of the file was uploaded