public interface BinaryStorage extends BinaryStorageBase
INSTANCE, LOG
Modifier and Type | Method and Description |
---|---|
boolean |
clear()
Wipe out all the binaries currently stored.
|
boolean |
delete(String... ids)
Delete the binaries stored under the given ids.
|
Consumer<File> |
fileCleaner()
Removes file in storage.
|
Optional<InputStream> |
get(String id)
Get the binary stored with the given id as an option.
|
String |
getBasePath() |
Set<String> |
getBinaryIds()
Get all ids.
|
Set<String> |
getBinaryIds(Predicate<String> filter)
Gets a set of ids, accepted by predicate, referring to binaries currently stored.
|
default String |
getBinaryPath(String binaryId) |
String |
getId()
Get the Binary Storage Id.
|
default URI |
getResolvedUri(URI uriToResolve)
Resolve uri with taking care of authority for UNC paths.
|
Set<String> |
listFolder(String pathRelativeToBasePath)
Get all folders which are sub-folders of provided relative path.
|
default void |
move(Path source,
Path target)
Moves one Path in storage to another.
|
void |
removeFolder(File folder,
boolean doLocking)
Remove folder in storage.
|
default boolean |
renameTo(File source,
File target)
Rename source in storage.
|
default void |
unzip(File zipArchive,
File targetLocation)
Unzip archive in storage.
|
contains, createDirectories, fileReader, fileWriter, flushWriter, folderFileReader, get, getWriter, put
String getId()
Optional<InputStream> get(String id)
id
- The given id.Set<String> getBinaryIds()
Set<String> listFolder(String pathRelativeToBasePath)
pathRelativeToBasePath
- Relative path to the base path.Set<String> getBinaryIds(Predicate<String> filter)
filter
- Predicate
to do filtering.boolean delete(String... ids)
ids
- The given ids.true
if the binaries were successfully deleted, false
otherwise.boolean clear()
true
if all the binaries were successfully deleted, false
otherwise.String getBasePath()
default void move(Path source, Path target) throws IOException
source
- initial source path.target
- target path.IOException
- move is failed.void removeFolder(File folder, boolean doLocking) throws IOException
folder
- to remove.doLocking
- locking flag.IOException
- remove is failed.default void unzip(File zipArchive, File targetLocation) throws IOException
zipArchive
- archive to unzip.targetLocation
- unzip to target folder.IOException
- failed unzipping.default boolean renameTo(File source, File target)
source
- file or folder to rename.target
- target file or folder.true
if renaming succeed.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries