public interface KeyValueAccess
N5KeyValueReader
implementations. This interface implements a subset of access primitives
provided by FileSystem to reduce the implementation burden for
backends lacking a FileSystem implementation (such as AWS-S3).| Modifier and Type | Method and Description |
|---|---|
default String[] |
components(String path)
Split a path string into its components.
|
default String |
compose(String... components)
Deprecated.
|
default String |
compose(URI uri,
String... components)
Compose a path from a base uri and subsequent components.
|
void |
createDirectories(String normalPath)
Create a directory and all parent paths along the way.
|
VolatileReadData |
createReadData(String normalPath)
Create a
VolatileReadData through which data at the normal key
can be read. |
void |
delete(String normalPath)
Delete a path.
|
boolean |
exists(String normalPath)
Test whether the path exists.
|
boolean |
isDirectory(String normalPath)
Test whether the path is a directory.
|
boolean |
isFile(String normalPath)
Test whether the path is a file.
|
String[] |
list(String normalPath)
List all children of a path.
|
String[] |
listDirectories(String normalPath)
List all 'directory'-like children of a path.
|
default LockedChannel |
lockForReading(String normalPath)
Deprecated.
migrate to
createReadData(String) |
default LockedChannel |
lockForWriting(String normalPath)
Deprecated.
migrate to
write(String, ReadData) |
String |
normalize(String path)
Normalize a path to canonical form.
|
default String |
parent(String path)
Get the parent of a path string.
|
default String |
relativize(String path,
String base)
Relativize path relative to base.
|
long |
size(String normalPath)
Returns the size in bytes of the object at the given normalPath if it exists.
|
default URI |
uri(String uriString)
Get the absolute (including scheme)
URI of the given path |
void |
write(String normalPath,
ReadData data)
Write
data to the given normalPath. |
default String[] components(String path)
path - the pathdefault String compose(URI uri, String... components)
uri - the base path uricomponents - the path components@Deprecated default String compose(String... components)
default String parent(String path)
path - the pathdefault String relativize(String path, String base)
path - the pathbase - the base pathString normalize(String path)
path - the pathdefault URI uri(String uriString) throws URISyntaxException
URI of the given pathuriString - is expected to be in normalized form, no further
efforts are made to normalize it.URISyntaxException - if the given path is not a proper URIboolean exists(String normalPath)
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.long size(String normalPath) throws N5Exception.N5NoSuchKeyException
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5NoSuchKeyException - if the given key does not existboolean isDirectory(String normalPath)
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.boolean isFile(String normalPath)
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.VolatileReadData createReadData(String normalPath) throws N5Exception.N5IOException
VolatileReadData through which data at the normal key
can be read.
Implementations should read lazily if possible. Consumers may call ReadData.materialize() to force a read operation if needed.
If supported by this KeyValueAccess implementation, partial reads are
possible by slicing the returned ReadData.
The resulting VolatileReadData is potentially lazy. If the requested
key does not exist, it will throw N5NoSuchKeyException. Whether
the exception is thrown when createReadData(String)] is called,
or when trying to materialize the VolatileReadData is implementation dependent.
normalPath - is expected to be in normalized form, no further efforts are made to normalize itN5Exception.N5IOException - if an error occursvoid write(String normalPath, ReadData data) throws N5Exception.N5IOException
data to the given normalPath.
Existing data at normalPath will be overridden.
normalPath - is expected to be in normalized form, no further efforts are made to normalize itdata - the data to writeN5Exception.N5IOException - if an error occurs@Deprecated default LockedChannel lockForReading(String normalPath) throws N5Exception.N5IOException
createReadData(String)
try (final lock = store.lockForReading()) {
...
}
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5IOException - if a locked channel could not be created@Deprecated default LockedChannel lockForWriting(String normalPath) throws N5Exception.N5IOException
write(String, ReadData)
try (final lock = store.lockForWriting()) {
...
}
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5IOException - if a locked channel could not be createdString[] listDirectories(String normalPath) throws N5Exception.N5IOException
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5IOException - if an error occurs during listingString[] list(String normalPath) throws N5Exception.N5IOException
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5IOException - if an error occurs during listingvoid createDirectories(String normalPath) throws N5Exception.N5IOException
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5IOException - if an error occurs during creationvoid delete(String normalPath) throws N5Exception.N5IOException
normalPath - is expected to be in normalized form, no further
efforts are made to normalize it.N5Exception.N5IOException - if an error occurs during deletionCopyright © 2017–2026 Saalfeld Lab. All rights reserved.