StorageClient

Represents a client for managing storage.

Methods

StorageFile getFile(StoragePath path) throws StorageFileNotFoundException

returns a file from storage.

StorageFileNotFoundException - error if the file is missing.


List<StoragePath> listPaths(StoragePath path)

returns file/directory paths inside the specified folder.


List<StoragePath> walk(StoragePath path)

returns the paths to all nested files/directories within the specified folder.


boolean exists(StoragePath path)

check for the existence of a file/directory.


void create(StoragePath path)

create an empty file/directory.


void put(StoragePath path, InputStream inputStream)

put a file with content.


void move(StoragePath fromPath, StoragePath toPath)

move or rename a file/directory.

fromPath - the path to the file/directory to move.

toPath - the path to the target file.


void copy(StoragePath sourcePath, StoragePath toPath)

copy a file/directory.

sourcePath - the path to the file to copy.

toPath - the path to the target file.


default boolean canPut(StoragePath path)

tests whether a file is writable.


void delete(StoragePath path, boolean force)

delete a file/directory. To remove a directory with files, set force as true, otherwise throw an error.

Realization

com.imcode.imcms.storage.impl.disk.DiskStorageClient - Server storage type.

com.imcode.imcms.storage.impl.cloud.CloudStorageClient - Cloud storage type.

com.imcode.imcms.storage.impl.cloud.CloudStorageClient - Syncronized storage type.