org.modeshape.jcr.value.binary

## Class TransientBinaryStore

- java.lang.Object
- - org.modeshape.jcr.value.binary.AbstractBinaryStore
  - - org.modeshape.jcr.value.binary.FileSystemBinaryStore
    - - org.modeshape.jcr.value.binary.TransientBinaryStore

- All Implemented Interfaces:
    BinaryStore

      @ThreadSafe
      public final class TransientBinaryStore
      extends FileSystemBinaryStore

  A `BinaryStore` implementation that does not persist the binary values beyond the lifetime of the virtual machine. This implementation extends `FileSystemBinaryStore` and uses a temporary directory. Thus, the binary values are not stored in-memory.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static File` | `TRANSIENT_STORE_DIRECTORY`

    - ### Fields inherited from class org.modeshape.jcr.value.binary.FileSystemBinaryStore

      `TRASH_DIRECTORY_NAME`

    - ### Fields inherited from class org.modeshape.jcr.value.binary.AbstractBinaryStore

      `logger, MEDIUM_BUFFER_SIZE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TransientBinaryStore` | `get()` Obtain a shared `TransientBinaryStore` instance.
    `protected void` | `initializeStorage(File directory)` Ensures that the directory used by this binary store exists and can be both read and written to.
    `void` | `start()` Initialize the store and get ready for use.

    - ### Methods inherited from class org.modeshape.jcr.value.binary.FileSystemBinaryStore

      `create, findFile, getAllBinaryKeys, getDirectory, getExtractedText, getInputStream, getStoredMimeType, markAsUnused, markAsUnused, markAsUsed, moveFileExclusively, pruneEmptyDirectories, removeAllTrashFilesFor, removeValuesUnusedLongerThan, storeExtractedText, storeMimeType, storeValue, touch, upgradeTrashContentFormat`

    - ### Methods inherited from class org.modeshape.jcr.value.binary.AbstractBinaryStore

      `bestBufferSize, detector, extractors, getMimeType, getMinimumBinarySizeInBytes, getText, hasBinary, setMimeTypeDetector, setMinimumBinarySizeInBytes, setTextExtractors, shutdown, storeValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TRANSIENT_STORE_DIRECTORY

          protected static final File TRANSIENT_STORE_DIRECTORY

  - ### Method Detail

    - #### get

          public static TransientBinaryStore get()

      Obtain a shared `TransientBinaryStore` instance.
      Returns:
        the instance; never null

    - #### start

          public void start()

      Description copied from interface: `BinaryStore`
      Initialize the store and get ready for use.
      Specified by:
        `start` in interface `BinaryStore`
      Overrides:
        `start` in class `AbstractBinaryStore`

    - #### initializeStorage

          protected void initializeStorage(File directory)
                                    throws BinaryStoreException

      Ensures that the directory used by this binary store exists and can be both read and written to.
      Overrides:
        `initializeStorage` in class `FileSystemBinaryStore`
      Throws:
        `BinaryStoreException` - if the directory cannot be written to, read, or (if needed) created

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.