org.exoplatform.clouddrive.cmis.ecms.viewer.storage
Class PDFViewerStorage
java.lang.Object
org.exoplatform.clouddrive.cmis.ecms.viewer.storage.PDFViewerStorage
public class PDFViewerStorage
- extends Object
Convert cloud file to PDF file a store it in temporary local file on the file system. This file can be used
for remote file representation in eXo Platform.
This class build on an idea of ECMS PDFViewerService but uses
CloudFile instead of JCR Node for file data.
This service uses ExoCache as a weak storage of spooled locally cloud files. The storage will be
cleaned if file/drive will be removed or the cache will be evicted.
Local files will be stored in JVM temporary folder in a tree hiearchy:
repository/workspace/username/driveTitle/fileId.
If remote file is not in PDF format it will be attempted to convert it to the PDF by
JodConverterService.
Created by The eXo Platform SAS
- Version:
- $Id: PDFViewerStorage.java 00000 Nov 25, 2014 pnedonosko $
- Author:
- Peter Nedonosko
|
Constructor Summary |
PDFViewerStorage(org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.services.cms.jodconverter.JodConverterService jodConverter)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_FILENAME_LENGTH
public static final int MAX_FILENAME_LENGTH
- See Also:
- Constant Field Values
FILE_LIVE_TIME
public static final long FILE_LIVE_TIME
- See Also:
- Constant Field Values
PAGE_IMAGE_TYPE
public static final String PAGE_IMAGE_TYPE
- See Also:
- Constant Field Values
PDF_TYPE
public static final String PDF_TYPE
- See Also:
- Constant Field Values
PAGE_IMAGE_EXT
public static final String PAGE_IMAGE_EXT
- See Also:
- Constant Field Values
PDF_EXT
public static final String PDF_EXT
- See Also:
- Constant Field Values
spool
protected final ConcurrentHashMap<PDFViewerStorage.FileKey,PDFViewerStorage.PDFFile> spool
jodConverter
protected final org.exoplatform.services.cms.jodconverter.JodConverterService jodConverter
rootDir
protected final File rootDir
cleaners
protected final ConcurrentHashMap<String,PDFViewerStorage.FilesCleaner> cleaners
PDFViewerStorage
public PDFViewerStorage(org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.services.cms.jodconverter.JodConverterService jodConverter)
throws IOException
- Throws:
IOException
getFile
public PDFViewerStorage.PDFFile getFile(String repository,
String workspace,
org.exoplatform.clouddrive.CloudDrive drive,
String fileId)
throws org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException
- Throws:
org.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException
createFile
public PDFViewerStorage.PDFFile createFile(String repository,
String workspace,
JCRLocalCMISDrive drive,
org.exoplatform.clouddrive.CloudFile file)
throws org.exoplatform.clouddrive.CloudDriveException,
org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException,
IOException
- Throws:
org.exoplatform.clouddrive.CloudDriveException
org.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException
IOException
Copyright © 2003–2015 eXo Platform SAS. All rights reserved.