Class StoreAreaAwareStoreWrapper
Object
com.liferay.document.library.kernel.store.StoreAreaAwareStoreWrapper
- All Implemented Interfaces:
Store
- Author:
- Adolfo Pérez
-
Field Summary
Fields inherited from interface com.liferay.document.library.kernel.store.Store
VERSION_DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionStoreAreaAwareStoreWrapper(Supplier<Store> storeSupplier, Supplier<StoreAreaProcessor> storeAreaProcessorSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFile(long companyId, long repositoryId, String fileName, String versionLabel, InputStream inputStream) Adds a file based on anInputStreamobject.voiddeleteDirectory(long companyId, long repositoryId, String dirName) Deletes a directory.voiddeleteFile(long companyId, long repositoryId, String fileName, String versionLabel) Deletes a file at a particular version.getFileAsStream(long companyId, long repositoryId, String fileName, String versionLabel) Returns the file as anInputStreamobject.String[]getFileNames(long companyId, long repositoryId, String dirName) Returns all files of the directory.longgetFileSize(long companyId, long repositoryId, String fileName, String versionLabel) Returns the size of the file.String[]getFileVersions(long companyId, long repositoryId, String fileName) booleanReturnstrueif the file exists.
-
Constructor Details
-
StoreAreaAwareStoreWrapper
public StoreAreaAwareStoreWrapper(Supplier<Store> storeSupplier, Supplier<StoreAreaProcessor> storeAreaProcessorSupplier)
-
-
Method Details
-
addFile
public void addFile(long companyId, long repositoryId, String fileName, String versionLabel, InputStream inputStream) throws PortalException Description copied from interface:StoreAdds a file based on anInputStreamobject.- Specified by:
addFilein interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)fileName- the file nameversionLabel- the file's version labelinputStream- the files's data- Throws:
PortalException
-
deleteDirectory
Description copied from interface:StoreDeletes a directory.- Specified by:
deleteDirectoryin interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)dirName- the directory's name
-
deleteFile
Description copied from interface:StoreDeletes a file at a particular version.- Specified by:
deleteFilein interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)fileName- the file's nameversionLabel- the file's version label
-
getFileAsStream
public InputStream getFileAsStream(long companyId, long repositoryId, String fileName, String versionLabel) throws PortalException Description copied from interface:StoreReturns the file as anInputStreamobject.- Specified by:
getFileAsStreamin interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)fileName- the file's nameversionLabel- the file's version label- Returns:
- Returns the
InputStreamobject with the file's name - Throws:
PortalException
-
getFileNames
Description copied from interface:StoreReturns all files of the directory.- Specified by:
getFileNamesin interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)dirName- the directory's name- Returns:
- Returns all files of the directory
-
getFileSize
public long getFileSize(long companyId, long repositoryId, String fileName, String versionLabel) throws PortalException Description copied from interface:StoreReturns the size of the file.- Specified by:
getFileSizein interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)fileName- the file's name- Returns:
- Returns the size of the file
- Throws:
PortalException
-
getFileVersions
- Specified by:
getFileVersionsin interfaceStore
-
hasFile
Description copied from interface:StoreReturnstrueif the file exists.- Specified by:
hasFilein interfaceStore- Parameters:
companyId- the primary key of the companyrepositoryId- the primary key of the data repository (optionallyCompanyConstants.SYSTEM)fileName- the file's nameversionLabel- the file's version label- Returns:
trueif the file exists;falseotherwise
-