com.liferay.portlet.documentlibrary.store
Class FileSystemStore

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.store.BaseStore
      extended by com.liferay.portlet.documentlibrary.store.FileSystemStore
All Implemented Interfaces:
com.liferay.portlet.documentlibrary.store.Store
Direct Known Subclasses:
AdvancedFileSystemStore

public class FileSystemStore
extends com.liferay.portlet.documentlibrary.store.BaseStore

Author:
Brian Wing Shun Chan, Sten Martinez, Alexander Chow, Edward Han

Field Summary
 
Fields inherited from interface com.liferay.portlet.documentlibrary.store.Store
VERSION_DEFAULT
 
Constructor Summary
FileSystemStore()
           
 
Method Summary
 void addDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
 void addFile(long companyId, long repositoryId, java.lang.String fileName, java.io.InputStream is)
           
 void checkRoot(long companyId)
           
 void copyFileVersion(long companyId, long repositoryId, java.lang.String fileName, java.lang.String fromVersionLabel, java.lang.String toVersionLabel)
           
 void deleteDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
protected  void deleteEmptyAncestors(java.io.File file)
           
protected  void deleteEmptyAncestors(long companyId, long repositoryId, java.io.File file)
           
 void deleteFile(long companyId, long repositoryId, java.lang.String fileName)
           
 void deleteFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
protected  java.io.File getCompanyDir(long companyId)
           
protected  java.io.File getDirNameDir(long companyId, long repositoryId, java.lang.String dirName)
           
 java.io.File getFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
 java.io.InputStream getFileAsStream(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
protected  java.io.File getFileNameDir(long companyId, long repositoryId, java.lang.String fileName)
           
 java.lang.String[] getFileNames(long companyId, long repositoryId)
           
 java.lang.String[] getFileNames(long companyId, long repositoryId, java.lang.String dirName)
           
protected  java.io.File getFileNameVersionFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String version)
           
 long getFileSize(long companyId, long repositoryId, java.lang.String fileName)
           
protected  java.lang.String getHeadVersionLabel(long companyId, long repositoryId, java.lang.String fileName)
           
protected  java.io.File getRepositoryDir(long companyId, long repositoryId)
           
 boolean hasDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
 boolean hasFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
 void move(java.lang.String srcDir, java.lang.String destDir)
           
 void updateFile(long companyId, long repositoryId, long newRepositoryId, java.lang.String fileName)
           
 void updateFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String newFileName)
           
 void updateFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel, java.io.InputStream is)
           
 void updateFileVersion(long companyId, long repositoryId, java.lang.String fileName, java.lang.String fromVersionLabel, java.lang.String toVersionLabel)
           
 
Methods inherited from class com.liferay.portlet.documentlibrary.store.BaseStore
addFile, addFile, getFile, getFileAsBytes, getFileAsBytes, getFileAsStream, hasFile, updateFile, updateFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemStore

public FileSystemStore()
Method Detail

addDirectory

public void addDirectory(long companyId,
                         long repositoryId,
                         java.lang.String dirName)
                  throws com.liferay.portal.kernel.exception.PortalException
Specified by:
addDirectory in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
addDirectory in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

addFile

public void addFile(long companyId,
                    long repositoryId,
                    java.lang.String fileName,
                    java.io.InputStream is)
             throws com.liferay.portal.kernel.exception.PortalException,
                    com.liferay.portal.kernel.exception.SystemException
Specified by:
addFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
addFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

checkRoot

public void checkRoot(long companyId)
Specified by:
checkRoot in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
checkRoot in class com.liferay.portlet.documentlibrary.store.BaseStore

copyFileVersion

public void copyFileVersion(long companyId,
                            long repositoryId,
                            java.lang.String fileName,
                            java.lang.String fromVersionLabel,
                            java.lang.String toVersionLabel)
                     throws com.liferay.portal.kernel.exception.PortalException,
                            com.liferay.portal.kernel.exception.SystemException
Specified by:
copyFileVersion in interface com.liferay.portlet.documentlibrary.store.Store
Overrides:
copyFileVersion in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

deleteDirectory

public void deleteDirectory(long companyId,
                            long repositoryId,
                            java.lang.String dirName)
                     throws com.liferay.portal.kernel.exception.PortalException
Specified by:
deleteDirectory in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
deleteDirectory in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

deleteFile

public void deleteFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName)
                throws com.liferay.portal.kernel.exception.PortalException
Specified by:
deleteFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
deleteFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

deleteFile

public void deleteFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String versionLabel)
                throws com.liferay.portal.kernel.exception.PortalException
Specified by:
deleteFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
deleteFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

getFile

public java.io.File getFile(long companyId,
                            long repositoryId,
                            java.lang.String fileName,
                            java.lang.String versionLabel)
                     throws com.liferay.portal.kernel.exception.PortalException
Specified by:
getFile in interface com.liferay.portlet.documentlibrary.store.Store
Overrides:
getFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

getFileAsStream

public java.io.InputStream getFileAsStream(long companyId,
                                           long repositoryId,
                                           java.lang.String fileName,
                                           java.lang.String versionLabel)
                                    throws com.liferay.portal.kernel.exception.PortalException
Specified by:
getFileAsStream in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
getFileAsStream in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

getFileNames

public java.lang.String[] getFileNames(long companyId,
                                       long repositoryId)

getFileNames

public java.lang.String[] getFileNames(long companyId,
                                       long repositoryId,
                                       java.lang.String dirName)
                                throws com.liferay.portal.kernel.exception.PortalException
Specified by:
getFileNames in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
getFileNames in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

getFileSize

public long getFileSize(long companyId,
                        long repositoryId,
                        java.lang.String fileName)
                 throws com.liferay.portal.kernel.exception.PortalException
Specified by:
getFileSize in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
getFileSize in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

hasDirectory

public boolean hasDirectory(long companyId,
                            long repositoryId,
                            java.lang.String dirName)
Specified by:
hasDirectory in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
hasDirectory in class com.liferay.portlet.documentlibrary.store.BaseStore

hasFile

public boolean hasFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String versionLabel)
Specified by:
hasFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
hasFile in class com.liferay.portlet.documentlibrary.store.BaseStore

move

public void move(java.lang.String srcDir,
                 java.lang.String destDir)
Specified by:
move in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
move in class com.liferay.portlet.documentlibrary.store.BaseStore

updateFile

public void updateFile(long companyId,
                       long repositoryId,
                       long newRepositoryId,
                       java.lang.String fileName)
                throws com.liferay.portal.kernel.exception.PortalException
Specified by:
updateFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
updateFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

updateFile

public void updateFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String newFileName)
                throws com.liferay.portal.kernel.exception.PortalException
Throws:
com.liferay.portal.kernel.exception.PortalException

updateFile

public void updateFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String versionLabel,
                       java.io.InputStream is)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Specified by:
updateFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
updateFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

updateFileVersion

public void updateFileVersion(long companyId,
                              long repositoryId,
                              java.lang.String fileName,
                              java.lang.String fromVersionLabel,
                              java.lang.String toVersionLabel)
                       throws com.liferay.portal.kernel.exception.PortalException
Specified by:
updateFileVersion in interface com.liferay.portlet.documentlibrary.store.Store
Overrides:
updateFileVersion in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

deleteEmptyAncestors

protected void deleteEmptyAncestors(java.io.File file)

deleteEmptyAncestors

protected void deleteEmptyAncestors(long companyId,
                                    long repositoryId,
                                    java.io.File file)

getCompanyDir

protected java.io.File getCompanyDir(long companyId)

getDirNameDir

protected java.io.File getDirNameDir(long companyId,
                                     long repositoryId,
                                     java.lang.String dirName)

getFileNameDir

protected java.io.File getFileNameDir(long companyId,
                                      long repositoryId,
                                      java.lang.String fileName)

getFileNameVersionFile

protected java.io.File getFileNameVersionFile(long companyId,
                                              long repositoryId,
                                              java.lang.String fileName,
                                              java.lang.String version)

getHeadVersionLabel

protected java.lang.String getHeadVersionLabel(long companyId,
                                               long repositoryId,
                                               java.lang.String fileName)

getRepositoryDir

protected java.io.File getRepositoryDir(long companyId,
                                        long repositoryId)