public class FileSystemMediaDriver extends Object implements CustomMediaDriver
The FileSystemMediaDriver allows content to be stored on a file system. No more content is stored in the database, only the document's metadata is stored in the database.
The location on the filesystem where the files are stored is set in a property that is defined on the CustomMediaDriverSpecification. Two other properties are defined as well:
| Modifier and Type | Field and Description | 
|---|---|
| static String | PROPERTY_BASE_PATHThe name of the MediaCustom property whose string value is the base
 path property name. | 
| static String | PROPERTY_DELETE_FILEThe name of the MediaCustom property whose string value is the
 Delete from filesystem property name. | 
| static String | PROPERTY_FILE_PREFIXThe name of the MediaCustom property whose string value is the
 FilePrefix property name. | 
| static String | PROPERTY_RELATIVE_PATH_FORMATThe name of the MediaCustom property whose string value is the
 relative path format property name. | 
| Constructor and Description | 
|---|
| FileSystemMediaDriver()Default constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | destroyContent(S_MediaCustom media,
              String address,
              Long cid,
              AttributeValue[] mediaOptions)Destroys content with the specified content address. | 
| InputStream | getContent(S_MediaCustom media,
          String address)Gets the content for the specified content address. | 
| long | getContentSize(S_MediaCustom media,
              String address)Gets the content size, in bytes, for the specified content address. | 
| static TimeZone | getDefaultTimeZone(S_LibrarySession session)Gets the default TimeZone. | 
| RandomAccessDriver | getRandomAccessorDriver(S_MediaCustom media,
                       String address)Gets a RandomAccessDriver for the specified content address. | 
| void | initialize(S_CustomMediaDriverSpecification cmds)Initializes this CustomMediaDriver. | 
| String | setContent(S_MediaCustom media,
          Long cid,
          InputStream is,
          AttributeValue[] mediaOptions)Stores content from the supplied InputStream. | 
| String | setContentReference(S_MediaCustom media,
                   Long cid,
                   String contentReference,
                   AttributeValue[] mediaOptions)Stores content determined from a specified content reference. | 
public static final String PROPERTY_BASE_PATH
The base path is the actual absolute path on the filesystem where the content will be stored.
public static final String PROPERTY_RELATIVE_PATH_FORMAT
The relative path format uses the date and time patterns defined in the SimpleDateFormat class.
SimpleDateFormat, 
Constant Field Valuespublic static final String PROPERTY_DELETE_FILE
The DeleteFileFromFileSystem property defines whether files should be removed from the filesystem if content is removed from the database.
public static final String PROPERTY_FILE_PREFIX
The FilePrefix property defines the prefix used when creating new files on the FileSystemMedia.
public void initialize(S_CustomMediaDriverSpecification cmds) throws IfsException
initialize in interface CustomMediaDrivercmds - the CustomMediaDriver specificationIfsException - 13800: if the operation failspublic InputStream getContent(S_MediaCustom media, String address) throws IfsException
getContent in interface CustomMediaDrivermedia - the MediaCustom instanceaddress - the content addressIfsException - 13801: if the operation failspublic long getContentSize(S_MediaCustom media, String address) throws IfsException
getContentSize in interface CustomMediaDrivermedia - the MediaCustom instanceaddress - the content addressIfsException - 13802: if the operation failspublic String setContent(S_MediaCustom media, Long cid, InputStream is, AttributeValue[] mediaOptions) throws IfsException
setContent in interface CustomMediaDrivermedia - the MediaCustom instancecid - the content idis - the contentmediaOptions - a set of name/value pairs whose semantics are
                      determined by the CustomMediaDriver implementation,
                      or null for no media optionsIfsException - 13803: if the operation failspublic String setContentReference(S_MediaCustom media, Long cid, String contentReference, AttributeValue[] mediaOptions) throws IfsException
 The interpretation of contentReference is determined by
 the CustomMediaDriver implementation.  Some implementations may store
 its value, while others may resolve its value (in a implementation
 determined fashion) to other content and store that content instead.
setContentReference in interface CustomMediaDrivermedia - the MediaCustom instancecid - the content idcontentReference - the content referencemediaOptions - a set of name/value pairs whose semantics are
                          determined by the CustomMediaDriver
                          implementation, or null for no media optionsIfsException - 13804: if the operation failspublic RandomAccessDriver getRandomAccessorDriver(S_MediaCustom media, String address) throws IfsException
getRandomAccessorDriver in interface CustomMediaDrivermedia - the MediaCustom instanceaddress - the content addressIfsException - 13805: if the operation failspublic void destroyContent(S_MediaCustom media, String address, Long cid, AttributeValue[] mediaOptions) throws IfsException
destroyContent in interface CustomMediaDrivermedia - the MediaCustom instanceaddress - the content addresscid - the content idmediaOptions - a set of name/value pairs whose semantics are
                      determined by the CustomMediaDriver implementation,
                      or null for no media optionsIfsException - 13806: if the operation failspublic static TimeZone getDefaultTimeZone(S_LibrarySession session) throws IfsException
session - session contextIfsException - if the operation failsCopyright © 2025. All rights reserved.