Package org.rapidcontext.app.model
Class AppStorage
- All Implemented Interfaces:
Comparable<Storage>
The application root storage. This overlays some storage aliases
and performs additional path validation.
- Version:
- 1.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Path
The current session path.static final Path
The current user path.Fields inherited from class org.rapidcontext.core.storage.RootStorage
PATH_FILES, PATH_LIB, PATH_STORAGE
Fields inherited from class org.rapidcontext.core.storage.Storage
EXT_ALL, EXT_JSON, EXT_PROPERTIES, EXT_XML, EXT_YAML, KEY_MOUNT_OVERLAY_PATH, KEY_MOUNT_OVERLAY_PRIO, KEY_MOUNT_PATH, KEY_MOUNT_TIME, KEY_READWRITE, PATH_STORAGEINFO
Fields inherited from class org.rapidcontext.core.storage.StorableObject
dict, KEY_ACTIVATED_TIME, KEY_CLASSNAME, KEY_ID, KEY_TYPE, PREFIX_COMPUTED, PREFIX_HIDDEN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isAccessible
(Path path) Checks if a storage path is valid for read access.Loads an object from the specified location.Searches for an object at the specified location and returns metadata about the object if found.Methods inherited from class org.rapidcontext.core.storage.RootStorage
cacheClean, isBinaryPath, isObjectPath, mount, mounts, remount, remove, store, unmount, unmountAll
Methods inherited from class org.rapidcontext.core.storage.MemoryStorage
destroy, isStorable, serialize
Methods inherited from class org.rapidcontext.core.storage.Storage
compareTo, isReadWrite, load, localPath, mountOverlayPath, mountOverlayPrio, mountTime, objectName, objectPath, path, query, serialize, serializedPath, setMountInfo, unserialize
Methods inherited from class org.rapidcontext.core.storage.StorableObject
activate, activatedTime, id, init, isActive, isModified, passivate, sterilize, toString, type
-
Field Details
-
SESSION_CURRENT
The current session path. -
USER_CURRENT
The current user path.
-
-
Constructor Details
-
AppStorage
public AppStorage()Creates a new application storage.
-
-
Method Details
-
isAccessible
Checks if a storage path is valid for read access. Only binary paths or paths without file extensions are accepted.- Parameters:
path
- the path to check- Returns:
- true if the path is valid, or false otherwise
-
lookup
Searches for an object at the specified location and returns metadata about the object if found. The path may locate either an index or a specific object.- Overrides:
lookup
in classRootStorage
- Parameters:
path
- the storage location- Returns:
- the metadata for the object, or null if not found
-
load
Loads an object from the specified location. The path may locate either an index or a specific object. In case of an index, the data returned is an index dictionary listing of all objects in it.- Overrides:
load
in classRootStorage
- Parameters:
path
- the storage location- Returns:
- the data read, or null if not found
-