public class VFS
extends java.lang.Object
implements java.lang.AutoCloseable
Constructor and Description |
---|
VFS(Context ctx)
Constructor for creating a new TileDB VFS handle
|
VFS(Context ctx,
Config config)
Constructor for creating new TileDB VFS handle with a given configuration
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Free's native TileDB resources associated with the VFS object
|
java.lang.String |
createBucket(java.lang.String path)
Creates an object store bucket.
|
java.net.URI |
createBucket(java.net.URI uri)
Creates an object store bucket.
|
java.lang.String |
createDirectory(java.lang.String path)
Creates a directory resource at the given path
|
java.net.URI |
createDirectory(java.net.URI uri)
Creates a directory resource at the given URI
|
java.lang.String |
createFile(java.lang.String path)
Creates an empty file resource at the given path
|
java.net.URI |
createFile(java.net.URI uri)
Creates an empty file resource
|
java.lang.String |
emptyBucket(java.lang.String path) |
java.net.URI |
emptyBucket(java.net.URI uri) |
long |
fileSize(java.lang.String path)
Returns the size of the VFS file resource in bytes
|
long |
fileSize(java.net.URI uri)
Returns the size fo the VFS file resource in bytes
|
Config |
getConfig()
Returns the Config object associated with the VFS instance
|
Context |
getContext()
Returns the Context associated with the VFS instance
|
protected SWIGTYPE_p_tiledb_vfs_t |
getVFSp()
Returns a handle to the underlying VFS SWIG pointer
|
boolean |
isBucket(java.lang.String path)
Checks if an object-store bucket exists.
|
boolean |
isBucket(java.net.URI uri)
Checks if an object-store bucket exists.
|
boolean |
isDirectory(java.lang.String path)
Checks if the given URI resource path is a directory
|
boolean |
isDirectory(java.net.URI uri)
Checks if the given URI is a directory resource
|
boolean |
isEmptyBucket(java.lang.String path)
Checks if an object-store bucket is empty
|
boolean |
isEmtpyBucket(java.net.URI uri)
Checks if an object-store bucket is empty
|
boolean |
isFile(java.lang.String path)
Checks if the given URI resource path string is a file
|
boolean |
isFile(java.net.URI uri)
Checks if the given URI is a file resource
|
boolean |
isSupportedFs(Filesystem fs)
Checks if the filesystem backend is supported for a given VFS instance
|
boolean |
isSupportedFs(java.lang.String fs)
Checks if the filesystem backend is supported for a given VFS URI scheme
|
boolean |
isSupportedFs(java.net.URI uri)
Checks if the filesystem backend if supported for a given VFS URI (scheme)
|
java.lang.String |
moveDirectory(java.lang.String source,
java.lang.String dest)
Renames a VFS directory resource
|
java.net.URI |
moveDirectory(java.net.URI source,
java.net.URI dest)
Renames a VFS directory resource
|
java.lang.String |
moveFile(java.lang.String source,
java.lang.String dest)
Renames a VFS file resource
|
java.net.URI |
moveFile(java.net.URI source,
java.net.URI dest)
Renames a VFS file resource
|
byte[] |
readAllBytes(java.lang.String path)
Reads all the bytes from a VFS file resource.
|
byte[] |
readAllBytes(java.net.URI path) |
java.lang.String |
removeBucket(java.lang.String path)
Deletes an object-store bucket.
|
java.net.URI |
removeBucket(java.net.URI uri)
Deletes an object-store bucket.
|
java.lang.String |
removeDirectory(java.lang.String path)
Removes a VFS directory resource (if exists)
|
java.net.URI |
removeDirectory(java.net.URI uri)
Removes a VFS directory resource (if exists)
|
java.lang.String |
removeFile(java.lang.String path)
Removes a VFS file resource (if exists)
|
java.net.URI |
removeFile(java.net.URI uri)
Removes a VFS file resource (if exists)
|
java.lang.String |
write(java.lang.String path,
byte[] bytes,
VFSMode... mode)
Write bytes to a given VFS file resource.
|
java.net.URI |
write(java.net.URI uri,
byte[] bytes,
VFSMode... mode)
Write bytes to a given VFS file resource.
|
public VFS(Context ctx, Config config) throws TileDBError
ctx
- The TileDB contextconfig
- A TileDB config objectTileDBError
- A TileDB exceptionpublic VFS(Context ctx) throws TileDBError
ctx
- A TileDB contextTileDBError
- A TileDB exceptionprotected SWIGTYPE_p_tiledb_vfs_t getVFSp()
public Config getConfig() throws TileDBError
TileDBError
- A TileDB exceptionpublic Context getContext()
public boolean isSupportedFs(Filesystem fs) throws TileDBError
fs
- TileDB Filesystem enumTileDBError
- A TileDB excpetionpublic boolean isSupportedFs(java.lang.String fs) throws TileDBError
fs
- TileDB filesystem string (ex. file, file://, s3, s3://, hdfs, hdfs://)TileDBError
- A TileDB exceptionpublic boolean isSupportedFs(java.net.URI uri) throws TileDBError
uri
- A URI with a given schemeTileDBError
- A TileDB exceptionpublic boolean isBucket(java.lang.String path) throws TileDBError
path
- String URI path to bucket resourceTileDBError
- A TileDB exceptionpublic boolean isBucket(java.net.URI uri) throws TileDBError
uri
- URI to bucket resourceTileDBError
- A TileDB exceptionpublic java.lang.String createBucket(java.lang.String path) throws TileDBError
path
- String URI path of bucket to be createdTileDBError
- A TileDB exceptionpublic java.net.URI createBucket(java.net.URI uri) throws TileDBError
uri
- URI of bucket to be createdTileDBError
- A TileDB exceptionpublic java.lang.String removeBucket(java.lang.String path) throws TileDBError
path
- String URI path of bucket to be deltedTileDBError
- A TileDB excpetionpublic java.net.URI removeBucket(java.net.URI uri) throws TileDBError
uri
- URI of bucket to be deletedTileDBError
- A TileDB exceptionpublic boolean isEmptyBucket(java.lang.String path) throws TileDBError
path
- A String uri of the bucketTileDBError
- A TileDB exceptionpublic boolean isEmtpyBucket(java.net.URI uri) throws TileDBError
uri
- URI of the bucketTileDBError
public java.lang.String emptyBucket(java.lang.String path) throws TileDBError
path
- TileDBError
- A TileDB exceptionpublic java.net.URI emptyBucket(java.net.URI uri) throws TileDBError
uri
- TileDBError
- A TileDB exceptionpublic boolean isFile(java.lang.String path) throws TileDBError
path
- String URI path to file resourceTileDBError
- A TileDB exceptionpublic boolean isFile(java.net.URI uri) throws TileDBError
uri
- URI path to resourceTileDBError
- A TileDB exceptionpublic boolean isDirectory(java.lang.String path) throws TileDBError
path
- String URI path to directory resourceTileDBError
- A TileDB exceptionpublic boolean isDirectory(java.net.URI uri) throws TileDBError
uri
- URI path to resourceTileDBError
- A TileDB exceptionpublic java.lang.String createDirectory(java.lang.String path) throws TileDBError
path
- String URI path of directory to createTileDBError
- A TileDB exceptionpublic java.net.URI createDirectory(java.net.URI uri) throws TileDBError
uri
- URI of directory to createTileDBError
- A TileDB exceptionpublic java.lang.String createFile(java.lang.String path) throws TileDBError
path
- String URI path of the empty file to createTileDBError
- A TileDB exceptionpublic java.net.URI createFile(java.net.URI uri) throws TileDBError
uri
- URI of file to createTileDBError
- A TileDB exceptionpublic java.lang.String removeDirectory(java.lang.String path) throws TileDBError
path
- String URI path of the directory to removeTileDBError
- A TileDB Exceptionpublic java.net.URI removeDirectory(java.net.URI uri) throws TileDBError
uri
- URI of directory to removeTileDBError
- A TileDB exceptionpublic java.lang.String removeFile(java.lang.String path) throws TileDBError
path
- String URI path of the file to removeTileDBError
- A TileDB exceptionpublic java.net.URI removeFile(java.net.URI uri) throws TileDBError
uri
- URI of the file to removeTileDBError
public long fileSize(java.lang.String path) throws TileDBError
path
- String URI path of the fileTileDBError
- A TileDB exceptionpublic long fileSize(java.net.URI uri) throws TileDBError
uri
- URI of file resourceTileDBError
- A TileDB exceptionpublic java.lang.String moveDirectory(java.lang.String source, java.lang.String dest) throws TileDBError
source
- Old URI stringdest
- New URI stringTileDBError
public java.net.URI moveDirectory(java.net.URI source, java.net.URI dest) throws TileDBError
source
- Old URIdest
- New URITileDBError
public java.lang.String moveFile(java.lang.String source, java.lang.String dest) throws TileDBError
source
- Old URI stringdest
- New URI stringTileDBError
- A TileDB exceptionpublic java.net.URI moveFile(java.net.URI source, java.net.URI dest) throws TileDBError
source
- Old URIdest
- New URITileDBError
- A TileDB exceptionpublic byte[] readAllBytes(java.lang.String path) throws TileDBError
Ensures that the file has been closed when all bytes have been read or an IO error is thrown. This is a convenience method and is not intended for reading large VFS files.
path
- the string URI path to the file resourceTileDBError
public byte[] readAllBytes(java.net.URI path) throws TileDBError
TileDBError
public java.lang.String write(java.lang.String path, byte[] bytes, VFSMode... mode) throws TileDBError
path
- The URI string resource pathbytes
- The byte array with the bytes to writemode
- VFSMode specifying how the file is opened, defaults to TILEDB_VFS_WRITE if
unspecifiedTileDBError
- A TileDB exceptionpublic java.net.URI write(java.net.URI uri, byte[] bytes, VFSMode... mode) throws TileDBError
uri
- The URI string resource pathbytes
- The byte array with the bytes to writemode
- VFSMode specifying how the file is opened, defaults to TILEDB_VFS_WRITE if
unspecifiedTileDBError
- A TileDB exceptionpublic void close()
close
in interface java.lang.AutoCloseable