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 TypeMethodDescriptionvoid
addFile
(long companyId, long repositoryId, String fileName, String versionLabel, InputStream inputStream) Adds a file based on anInputStream
object.void
deleteDirectory
(long companyId, long repositoryId, String dirName) Deletes a directory.void
deleteFile
(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 anInputStream
object.String[]
getFileNames
(long companyId, long repositoryId, String dirName) Returns all files of the directory.long
getFileSize
(long companyId, long repositoryId, String fileName, String versionLabel) Returns the size of the file.String[]
getFileVersions
(long companyId, long repositoryId, String fileName) boolean
Returnstrue
if 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:Store
Adds a file based on anInputStream
object.- Specified by:
addFile
in 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:Store
Deletes a directory.- Specified by:
deleteDirectory
in 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:Store
Deletes a file at a particular version.- Specified by:
deleteFile
in 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:Store
Returns the file as anInputStream
object.- Specified by:
getFileAsStream
in 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
InputStream
object with the file's name - Throws:
PortalException
-
getFileNames
Description copied from interface:Store
Returns all files of the directory.- Specified by:
getFileNames
in 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:Store
Returns the size of the file.- Specified by:
getFileSize
in 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:
getFileVersions
in interfaceStore
-
hasFile
Description copied from interface:Store
Returnstrue
if the file exists.- Specified by:
hasFile
in 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:
true
if the file exists;false
otherwise
-