Part of lp.soyuz.interfaces.archivefile View In Hierarchy
Method | new | Create a new IArchiveFile . |
Method | newFromFile | Create a new IArchiveFile from a file on the file system. |
Method | getByArchive | Get files in an archive. |
Method | scheduleDeletion | Schedule these archive files for future deletion. |
Method | unscheduleDeletion | Unschedule these archive files for deletion. |
Method | getContainersToReap | Return containers in this archive with files that should be reaped. |
Method | reap | Delete archive files that are past their scheduled deletion date. |
IArchiveFile
.Parameters | archive | The IArchive containing the new file. |
container | An identifier for the component that manages this file. | |
path | The path to the new file within its archive. | |
library_file | The ILibraryFileAlias embodying the new file. |
IArchiveFile
from a file on the file system.Parameters | archive | The IArchive containing the new file. |
container | An identifier for the component that manages this file. | |
path | The path to the new file within its archive. | |
fileobj | A file-like object to read the data from. | |
size | The size of the file in bytes. | |
content_type | The MIME type of the file. |
Parameters | archive | Return files in this IArchive . |
container | Return only files with this container. | |
path | Return only files with this path. | |
only_condemned | If True, return only files with a scheduled_deletion_date set. | |
eager_load | If True, preload related LibraryFileAlias and
LibraryFileContent rows. | |
Returns | An iterable of matched files. |
Schedule these archive files for future deletion. :param archive_files: The `IArchiveFile`s to schedule for deletion. :param stay_of_execution: A `timedelta`; schedule files for deletion this amount of time in the future. :return: An iterable of (container, path, sha256) for files that were scheduled for deletion.
Unschedule these archive files for deletion. This is useful in the case when the new content of a file is identical to a version that was previously condemned. :param archive_files: The `IArchiveFile`s to unschedule for deletion. :return: An iterable of (container, path, sha256) for files that were unscheduled for deletion.