Class TextFileSystemViewCrudMapAdapter<Entry>

    • Method Detail

      • delete

        public void delete​(String fileId)
        Description copied from interface: CrudMapAdapter
        Removes the mapping for the given key.
        Specified by:
        delete in interface CrudMapAdapter<String,​String>
        Parameters:
        fileId - Key to disassociate with any values.
      • get

        public String get​(String fileId)
        Description copied from interface: CrudMapAdapter
        Gets the value for the given key. Returns null when no value is available for the key.
        Specified by:
        get in interface CrudMapAdapter<String,​String>
        Parameters:
        fileId - Key to access.
        Returns:
        The value associated with the key, or null when no value is associated with the key.
      • set

        public void set​(String fileId,
                        String content)
        Description copied from interface: CrudMapAdapter
        Associates a value with the given key.
        Specified by:
        set in interface CrudMapAdapter<String,​String>
        Parameters:
        fileId - Key to associate with a different value.
        content - Value to associate with the key, never null.
      • builder

        public static <Entry> TextFileSystemViewCrudMapAdapter.Builder<Entry> builder​(ISerializableFunction<Entry,​String> entryEncoder,
                                                                                      ISerializableFunction<String,​Entry> entryDecoder)
        Creates a new builder for a TextFileSystemViewCrudMapAdapter, using the given encoder and decoder to convert between a file ID and a file system entry.

        Uses a ICommonFileSystem to read and write file text content. The map key is the file ID (as returned by the configured entry encoder), the map value is the file's text content. Uses the configured charset to encode and decode the binary data to / from strings.

        Type Parameters:
        Entry - The type of the file system entry.
        Parameters:
        entryEncoder - Encoder that converts a file system entry to a file ID string.
        entryDecoder - Decoder that converts a file ID string to a file system entry.
        Returns:
        A new builder for a TextFileSystemViewCrudMapAdapter.