geonode.storage.manager

Attributes

logger

storage_manager

Classes

StorageManagerInterface

StorageManager

Manage the files with different filestorages configured by default is the Filesystem one.

DefaultStorageManager

Module Contents

geonode.storage.manager.logger[source]
class geonode.storage.manager.StorageManagerInterface[source]
abstract delete(name)[source]
abstract exists(name)[source]
abstract listdir(path)[source]
rmtree(path, ignore_errors=False)[source]
abstract open(name, mode='rb')[source]
abstract path(name)[source]
abstract save(name, content, max_length=None)[source]
abstract url(name)[source]
abstract size(name)[source]
abstract generate_filename(filename)[source]
replace(resource, files: list | BinaryIO)[source]
copy(resource)[source]
class geonode.storage.manager.StorageManager(remote_files: Mapping = {})[source]

Bases: StorageManagerInterface

Manage the files with different filestorages configured by default is the Filesystem one. If the file is not in the FileSystem, we try to transfer it on the local filesystem and then treat as a file_system file

_concrete_storage_manager[source]
data_retriever[source]
_get_concrete_manager()[source]
delete(name)[source]
exists(name)[source]
listdir(path)[source]
rmtree(path, ignore_errors=False)[source]
open(name, mode='rb')[source]
path(name)[source]
save(name, content, max_length=None)[source]
size(name)[source]
url(name)[source]
replace(resource, files: list | BinaryIO)[source]
copy(resource)[source]
copy_files_list(files: List[str])[source]
copy_single_file(old_file: BinaryIO, new_file: str)[source]
replace_files_list(old_files: List[str], new_files: List[str])[source]
replace_single_file(old_file: str, new_file: BinaryIO, prefix: str = None)[source]
generate_filename(filename)[source]
clone_remote_files() Mapping[source]

Using the data retriever object clone the remote path into a local temporary storage

get_retrieved_paths() Mapping[source]

Return the path of the local objects in the temporary folder. We convert them as string instead of PosixPath

delete_retrieved_paths(force=False) None[source]

Delete cloned object from the temporary folder. By default if the folder is under the MEDIA_ROOT the file is not deleted. In case should be deleted, the force=True is required

class geonode.storage.manager.DefaultStorageManager[source]

Bases: StorageManagerInterface

_fsm[source]
_get_concrete_manager()[source]
delete(name)[source]
exists(name)[source]
listdir(path)[source]
rmtree(path, ignore_errors=False)[source]
open(name, mode='rb')[source]
path(name)[source]
save(name, content, max_length=None)[source]
size(name)[source]
url(name)[source]
generate_filename(filename)[source]
geonode.storage.manager.storage_manager[source]