Class ObjectStorageImpl

    • Constructor Detail

      • ObjectStorageImpl

        @Inject
        public ObjectStorageImpl​(@Named("configIO")
                                 org.uberfire.io.IOService ioService)
    • Method Detail

      • init

        public void init​(URI rootURI)
        Description copied from interface: ObjectStorage
        Initialize the object storage.
        Specified by:
        init in interface ObjectStorage
        Parameters:
        rootURI - The root URI where is going to create the file system
      • exists

        public boolean exists​(String path)
        Description copied from interface: ObjectStorage
        Checks if a path exists into the object storage.
        Specified by:
        exists in interface ObjectStorage
        Parameters:
        path - the path to the stored object.
        Returns:
        true if exists that path into the storage else false.
      • read

        public <T> T read​(String path)
        Description copied from interface: ObjectStorage
        Read the content of the path given
        Specified by:
        read in interface ObjectStorage
        Parameters:
        path - The path where the content is stored
        Returns:
        The content of the file unmarshalled
      • write

        public <T> void write​(String path,
                              T value)
        Description copied from interface: ObjectStorage
        Write an object into the object storage. That object is marshalled into JSON. Lock will be enabled before write and disabled after it.
        Specified by:
        write in interface ObjectStorage
        Parameters:
        path - The path where the object is going to be written
        value - The object itself
      • write

        public <T> void write​(String path,
                              T value,
                              boolean lock)
        Description copied from interface: ObjectStorage
        Write an object into the object storage. That object is marshalled into JSON. You can avoid FS lock
        Specified by:
        write in interface ObjectStorage
        Parameters:
        path - The path where the object is going to be written
        value - The object itself
        lock - If the object storage should be locked while writing
      • delete

        public void delete​(String path)
        Description copied from interface: ObjectStorage
        Delete a path from the object storage if exists. That path contains the object stored.
        Specified by:
        delete in interface ObjectStorage
        Parameters:
        path - The path to delete
      • getPath

        public org.uberfire.java.nio.file.Path getPath​(String first,
                                                       String... paths)
        Description copied from interface: ObjectStorage
        Return a path based on the filesystem that is implemented for storage
        Specified by:
        getPath in interface ObjectStorage
        Parameters:
        first - the path string or initial part of the path string
        paths - additional strings to be joined to form the path string
        Returns:
        the path object that represents the path.