CBFS Storage 2020 Node.js Edition

Questions / Feedback?

CBVault Class

Properties   Methods   Events   Configuration Settings   Errors  

The CBVault class lets applications create a vault and manipulate its contents.

Syntax

cbfsstorage.cbvault()

Remarks

The CBVault class allows applications to create a vault and interact with its contents directly. A vault can contain any number of files, directories, alternate streams, and symbolic links; so long as it has sufficient capacity to store them. For more information about using CBFS Storage's many features, please refer to the extensive General Information topics.

The CBVault class is available on all platforms, supported by the CBFS Storage product.

Getting Started

Each CBVault class instance can control a single vault at once. Applications can use multiple instances of the CBVault class if their use-case requires multiple vaults.

Here's how to get up and running:

  1. Create or open a vault by calling the OpenVault method.
  2. Interact with the vault, and its contents, using the CBVault class's API methods.
  3. When done, call the CloseVault method to close the vault.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

ActiveWhether a vault has been opened.
AutoCompactAtThe free space percentage threshold a vault must reach to be eligible for automatic compaction.
CallbackModeWhether the class should operate in callback mode.
CaseSensitiveWhether the class should open a vault in case-sensitive mode.
DefaultFileCompressionThe default compression mode to use when creating files and alternate streams.
DefaultFileEncryptionThe default encryption mode to use when creating files and alternate streams.
DefaultFilePasswordThe default encryption password to use when creating or opening files and alternate streams.
IsCorruptedWhether the vault is corrupted.
LastWriteTimeThe last modification time of the vault.
LogoAn application-defined text-based logo stored in the second page of a vault.
PageSizeThe vault's page size.
PathSeparatorThe path separator character to use when returning vault paths.
PossibleFreeSpaceThe maximum amount of free space the vault could possibly have available.
PossibleSizeThe maximum size the vault could possibly be.
ReadOnlyWhether the class should open a vault in read-only mode.
TagStores application-defined data specific to this instance of the class.
UseAccessTimeWhether the class should keep track of last access times for vault items.
UseJournalingWhether the class should open a vault in journaling mode.
UseSystemCacheWhether the operating system's cache is used.
VaultEncryptionThe whole-vault encryption mode.
VaultFileThe vault to create and/or open.
VaultFreeSpaceThe actual amount of free space the vault has available.
VaultPasswordThe whole-vault encryption password.
VaultSizeThe actual size of the vault.
VaultSizeMaxThe maximum size a vault can be.
VaultSizeMinThe minimum size a vault can be.
VaultStateInformation about the state of the vault.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

CacheFilePasswordCaches an encryption password to use the next time a file or alternate stream is accessed.
CheckAndRepairChecks a vault's consistency and repairs it as necessary.
CheckFilePasswordVerifies whether a particular file password is correct.
CheckVaultPasswordVerifies whether a particular vault password is correct.
CloseVaultCloses the vault.
CompactVaultCompacts the vault.
ConfigSets or retrieves a configuration setting.
CopyFromVaultCopies files and directories from the vault to a physical filesystem.
CopyToVaultCopies files and directories from a physical filesystem to the vault.
CreateDirectoryCreates a new directory in the vault.
CreateLinkCreates a symbolic link to another file in the vault.
DeleteFileDeletes a vault item.
DeleteFileTagDeletes a file tag.
FileExistsChecks whether a vault item exists.
FileMatchesMaskChecks whether a particular file or directory name matches the specified mask.
FileTagExistsChecks whether a file tag exists.
FindCloseCloses a search operation and releases any associated resources.
FindFirstSearches for the first vault item that matches the specified name and attributes.
FindFirstByQuerySearches for the first file or directory whose file tags match the specified query.
FindNextSearches for the next vault item that matches an ongoing search operation.
GetFileAttributesRetrieves the attributes of a vault item.
GetFileCompressionRetrieves the compression mode of a file or alternate stream.
GetFileCreationTimeRetrieves the creation time of a vault item.
GetFileEncryptionRetrieves the encryption mode of a file or alternate stream.
GetFileLastAccessTimeRetrieves the last access time of a vault item.
GetFileMetadataSizeRetrieves the size of the metadata associated with a vault item.
GetFileModificationTimeRetrieves the modification time of a vault item.
GetFileSizeRetrieves the size of a file or alternate stream.
GetFileTagRetrieves the binary data held by a raw file tag attached to the specified vault item.
GetFileTagAsAnsiStringRetrieves the value of an AnsiString-typed file tag attached to the specified vault item.
GetFileTagAsBooleanRetrieves the value of a Boolean-typed file tag attached to the specified vault item.
GetFileTagAsDateTimeRetrieves the value of a DateTime-typed file tag attached to the specified vault item.
GetFileTagAsNumberRetrieves the value of a Number-typed file tag attached to the specified vault item.
GetFileTagAsStringRetrieves the value of a String-typed file tag attached to the specified vault item.
GetFileTagDataTypeRetrieves the data type of a typed file tag attached to a specific vault item.
GetFileTagSizeRetrieves the size of a raw file tag attached to the specified vault item.
GetOriginatorProcessIdRetrieves the Id of the process (PID) that initiated the operation.
GetOriginatorProcessNameRetrieves the name of the process that initiated the operation.
GetOriginatorThreadIdRetrieves the Id of the thread that initiated the operation. (Windows only).
GetOriginatorTokenRetrieves the security token associated with the process that initiated the operation. (Windows only).
GetSearchResultAttributesRetrieves the attributes of a vault item found during a search operation.
GetSearchResultCreationTimeRetrieves the creation time of a vault item found during a search operation.
GetSearchResultFullNameRetrieves the fully-qualified name of a vault item found during a search operation.
GetSearchResultLastAccessTimeRetrieves the last access time of a vault item found during a search operation.
GetSearchResultLinkDestinationRetrieves the destination of a symbolic link found during a search operation.
GetSearchResultMetadataSizeRetrieves the size of the metadata associated with a vault item found during a search operation.
GetSearchResultModificationTimeRetrieves the modification time of a vault item found during a search operation.
GetSearchResultNameRetrieves the name of a vault item found during a search operation.
GetSearchResultSizeRetrieves the size of a vault item found during a search operation.
IsCBFSStorageVaultChecks whether a local file is a CBFS Storage vault.
IsDirectoryEmptyChecks whether a directory is empty.
MoveFileRenames or moves a vault item.
OpenFileOpens a new or existing file or alternate stream in the vault.
OpenFileExOpens a new or existing file or alternate stream in the vault.
OpenRootDataOpens the vault's root data stream.
OpenVaultOpens a new or existing vault.
ResolveLinkRetrieves the destination of a symbolic link.
SetFileAttributesSets the attributes of a vault item.
SetFileCompressionCompresses or decompresses a file or alternate stream.
SetFileCreationTimeSets the creation time of a vault item.
SetFileEncryptionEncrypts, decrypts, or changes the encryption password of a file or alternate stream.
SetFileLastAccessTimeSets the last access time of a vault item.
SetFileModificationTimeSets the modification time of a vault item.
SetFileSizeSets the size of a file or alternate stream.
SetFileTagAttaches a raw file tag with binary data to the specified vault item.
SetFileTagAsAnsiStringAttaches an AnsiString-typed file tag to the specified vault item.
SetFileTagAsBooleanAttaches a Boolean-typed file tag to the specified vault item.
SetFileTagAsDateTimeAttaches a DateTime-typed file tag to the specified vault item.
SetFileTagAsNumberAttaches a Number-typed file tag to the specified vault item.
SetFileTagAsStringAttaches a String-typed file tag to the specified vault item.
UpdateVaultEncryptionEncrypts, decrypts, or changes the encryption password of the vault.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

DataCompressFires to compress a block of data using a custom compression algorithm.
DataDecompressFires to decompress a block of data using a custom compression algorithm.
DataDecryptFires to decrypt a block of data using a custom encryption implementation.
DataEncryptFires to encrypt a block of data using a custom encryption implementation.
ErrorFires if an unhandled error occurs during an event.
FilePasswordNeededFires if a password is needed to open an encrypted file.
HashCalculateFires to calculate a password hash using a custom hashing implementation.
KeyDeriveFires to derive an encryption key using a custom key derivation implementation.
ProgressFires to indicate the progress of long-running vault operations.
VaultCloseFires to close a callback mode vault.
VaultDeleteFires to delete a callback mode vault.
VaultFlushFires to flush a callback mode vault's data out to storage.
VaultGetParentSizeFires to determine how much free space is available for growing a callback mode vault.
VaultGetSizeFires to determine the size of a callback mode vault.
VaultOpenFires to open a new or existing callback mode vault.
VaultReadFires to read data from a callback mode vault.
VaultSetSizeFires to resize a callback mode vault.
VaultWriteFires to write data to a callback mode vault.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

AllowMoveStreamsBetweenFilesWhether alternate streams may be moved from one file to another.
AlwaysJournalMetadataWhether filesystem structure is always saved during modification, like in Journaling mode.
AutoCompactDelayHow long a vault must remain idle before starting automatic compaction.
DefaultFileCompressionLevelThe default compression level to use when creating files and alternate streams.
MaxNonPagedNameLengthThe maximum number of name characters to store directly within a vault item.
PageCacheSizeThe size of the in-memory vault page cache.
PartSizeThe part size used by a multipart vault.

Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Storage 2020 Node.js Edition - Version 20.0 [Build 7922]