Interface Store
- All Known Implementing Classes:
StoreAreaAwareStoreWrapper
@ProviderType
public interface Store
The interface for all file store implementations. Most, if not all
implementations should extend from the class
BaseStore
.- Author:
- Brian Wing Shun Chan, Edward Han
- See Also:
-
BaseStore
-
Field Summary
Fields -
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.
-
Field Details
-
VERSION_DEFAULT
- See Also:
-
-
Method Details
-
addFile
void addFile(long companyId, long repositoryId, String fileName, String versionLabel, InputStream inputStream) throws PortalException Adds a file based on anInputStream
object.- 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
Deletes a directory.- Parameters:
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionallyCompanyConstants.SYSTEM
)dirName
- the directory's name
-
deleteFile
Deletes a file at a particular version.- 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
InputStream getFileAsStream(long companyId, long repositoryId, String fileName, String versionLabel) throws PortalException Returns the file as anInputStream
object.- 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
Returns all files of the directory.- 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
long getFileSize(long companyId, long repositoryId, String fileName, String versionLabel) throws PortalException Returns the size of the file.- 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
-
hasFile
Returnstrue
if the file exists.- 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
-