Search in sources :

Example 1 with NonTransactionalRuleContentDiskDriver

use of org.alfresco.filesys.repo.NonTransactionalRuleContentDiskDriver in project alfresco-repository by Alfresco.

the class ServerConfigurationBean method isContentDiskDriver2.

/**
 * Returns true if either: the disk interface is a ContentDiskDriver2; or
 * the disk interface is a {@link BufferedContentDiskDriver} and its disk
 * interface is a ContentDiskDriver2 (wrapped by several other DiskInterface objects).
 *
 * @param diskInterface ExtendedDiskInterface
 * @return boolean
 */
private boolean isContentDiskDriver2(ExtendedDiskInterface diskInterface) {
    if (diskInterface instanceof ContentDiskDriver2) {
        return true;
    }
    if (diskInterface instanceof BufferedContentDiskDriver) {
        BufferedContentDiskDriver bufferedDriver = (BufferedContentDiskDriver) diskInterface;
        ExtendedDiskInterface underlyingDriver = bufferedDriver.getDiskInterface();
        if (underlyingDriver instanceof LegacyFileStateDriver) {
            LegacyFileStateDriver legacyDriver = (LegacyFileStateDriver) underlyingDriver;
            underlyingDriver = legacyDriver.getDiskInterface();
            if (underlyingDriver instanceof NonTransactionalRuleContentDiskDriver) {
                // say for sure if it is a ContentDiskDriver2.
                return true;
            }
        }
    }
    return false;
}
Also used : ContentDiskDriver2(org.alfresco.filesys.repo.ContentDiskDriver2) BufferedContentDiskDriver(org.alfresco.filesys.repo.BufferedContentDiskDriver) NonTransactionalRuleContentDiskDriver(org.alfresco.filesys.repo.NonTransactionalRuleContentDiskDriver) LegacyFileStateDriver(org.alfresco.filesys.repo.LegacyFileStateDriver) ExtendedDiskInterface(org.alfresco.filesys.alfresco.ExtendedDiskInterface)

Aggregations

ExtendedDiskInterface (org.alfresco.filesys.alfresco.ExtendedDiskInterface)1 BufferedContentDiskDriver (org.alfresco.filesys.repo.BufferedContentDiskDriver)1 ContentDiskDriver2 (org.alfresco.filesys.repo.ContentDiskDriver2)1 LegacyFileStateDriver (org.alfresco.filesys.repo.LegacyFileStateDriver)1 NonTransactionalRuleContentDiskDriver (org.alfresco.filesys.repo.NonTransactionalRuleContentDiskDriver)1