|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portlet.documentlibrary.store.BaseStore com.liferay.portlet.documentlibrary.store.S3Store
public class S3Store
Field Summary |
---|
Fields inherited from interface com.liferay.portlet.documentlibrary.store.Store |
---|
VERSION_DEFAULT |
Constructor Summary | |
---|---|
S3Store()
|
Method Summary | |
---|---|
void |
addDirectory(long companyId,
long repositoryId,
String dirName)
Adds a directory. |
void |
addFile(long companyId,
long repositoryId,
String fileName,
InputStream is)
Adds a file based on an InputStream object. |
void |
checkRoot(long companyId)
Ensures company's root directory exists. |
protected void |
cleanUpTempFiles()
|
protected void |
cleanUpTempFiles(File file,
long lastModified)
|
void |
deleteDirectory(long companyId,
long repositoryId,
String dirName)
Deletes a directory. |
void |
deleteFile(long companyId,
long repositoryId,
String fileName)
Deletes a file. |
void |
deleteFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Deletes a file at a particular version. |
protected org.jets3t.service.security.AWSCredentials |
getAWSCredentials()
|
File |
getFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns the file as a File object. |
InputStream |
getFileAsStream(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns the file as an InputStream object. |
protected String |
getFileName(String key)
|
String[] |
getFileNames(long companyId,
long repositoryId)
|
String[] |
getFileNames(long companyId,
long repositoryId,
String dirName)
Returns all files of the directory. |
protected String[] |
getFileNames(org.jets3t.service.model.S3Object[] s3Objects)
|
long |
getFileSize(long companyId,
long repositoryId,
String fileName)
Returns the size of the file. |
protected String |
getHeadVersionLabel(long companyId,
long repositoryId,
String fileName)
|
protected String |
getKey(long companyId,
long repositoryId)
|
protected String |
getKey(long companyId,
long repositoryId,
String fileName)
|
protected String |
getKey(long companyId,
long repositoryId,
String fileName,
String versionLabel)
|
protected String |
getNormalizedFileName(String fileName)
|
protected org.jets3t.service.model.S3Bucket |
getS3Bucket()
|
protected org.jets3t.service.S3Service |
getS3Service()
|
protected File |
getTempFile(org.jets3t.service.model.S3Object s3Object,
String fileName)
|
boolean |
hasDirectory(long companyId,
long repositoryId,
String dirName)
Returns true if the directory exists. |
boolean |
hasFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns true if the file exists. |
void |
move(String srcDir,
String destDir)
Moves an existing directory. |
void |
updateFile(long companyId,
long repositoryId,
long newRepositoryId,
String fileName)
Moves a file to a new data repository. |
void |
updateFile(long companyId,
long repositoryId,
String fileName,
String newFileName)
|
void |
updateFile(long companyId,
long repositoryId,
String fileName,
String versionLabel,
InputStream is)
Updates a file based on an InputStream object. |
Methods inherited from class com.liferay.portlet.documentlibrary.store.BaseStore |
---|
addFile, addFile, copyFileVersion, getFile, getFileAsBytes, getFileAsBytes, getFileAsStream, hasFile, updateFile, updateFile, updateFileVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public S3Store()
Method Detail |
---|
public void addDirectory(long companyId, long repositoryId, String dirName)
BaseStore
addDirectory
in interface Store
addDirectory
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)dirName
- the directory's namepublic void addFile(long companyId, long repositoryId, String fileName, InputStream is) throws SystemException
BaseStore
InputStream
object.
addFile
in interface Store
addFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file nameis
- the files's data
SystemException
- if a system exception occurredpublic void checkRoot(long companyId)
BaseStore
JCRStore.checkRoot(long)
.
checkRoot
in interface Store
checkRoot
in class BaseStore
companyId
- the primary key of the companypublic void deleteDirectory(long companyId, long repositoryId, String dirName) throws SystemException
BaseStore
deleteDirectory
in interface Store
deleteDirectory
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)dirName
- the directory's name
SystemException
- if a system exception occurredpublic void deleteFile(long companyId, long repositoryId, String fileName) throws SystemException
BaseStore
deleteFile
in interface Store
deleteFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file's name
SystemException
- if a system exception occurredpublic void deleteFile(long companyId, long repositoryId, String fileName, String versionLabel) throws SystemException
BaseStore
deleteFile
in interface Store
deleteFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file's nameversionLabel
- the file's version label
SystemException
- if a system exception occurredpublic File getFile(long companyId, long repositoryId, String fileName, String versionLabel) throws PortalException, SystemException
BaseStore
File
object.
This method is useful when optimizing low-level file operations like
copy. The client must not delete or change the returned File
object in any way. This method is only supported in certain stores. If
not supported, this method will throw an UnsupportedOperationException
.
This method should be overrided if a more optimized approach can be used
(e.g., FileSystemStore.getFile(long, long, String, String)
).
getFile
in interface Store
getFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file's nameversionLabel
- the file's version label
File
object with the file's name
PortalException
- if the file's information was invalid
SystemException
- if a system exception occurredpublic InputStream getFileAsStream(long companyId, long repositoryId, String fileName, String versionLabel) throws PortalException, SystemException
BaseStore
InputStream
object.
getFileAsStream
in interface Store
getFileAsStream
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file's nameversionLabel
- the file's version label
InputStream
object with the file's name
PortalException
- if the file's information was invalid
SystemException
- if a system exception occurredpublic String[] getFileNames(long companyId, long repositoryId) throws SystemException
SystemException
public String[] getFileNames(long companyId, long repositoryId, String dirName) throws SystemException
BaseStore
getFileNames
in interface Store
getFileNames
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)dirName
- the directory's name
SystemException
- if a system exception occurredpublic long getFileSize(long companyId, long repositoryId, String fileName) throws PortalException, SystemException
BaseStore
getFileSize
in interface Store
getFileSize
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file's name
PortalException
- if the file's information was invalid
SystemException
- if a system exception occurredpublic boolean hasDirectory(long companyId, long repositoryId, String dirName)
BaseStore
true
if the directory exists.
hasDirectory
in interface Store
hasDirectory
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)dirName
- the directory's name
true
if the directory exists; false
otherwisepublic boolean hasFile(long companyId, long repositoryId, String fileName, String versionLabel) throws SystemException
BaseStore
true
if the file exists.
hasFile
in interface Store
hasFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file's nameversionLabel
- the file's version label
true
if the file exists; false
otherwise
SystemException
- if a system exception occurredpublic void move(String srcDir, String destDir)
BaseStore
JCRStore.move(String, String)
.
move
in interface Store
move
in class BaseStore
srcDir
- the original directory's namedestDir
- the new directory's namepublic void updateFile(long companyId, long repositoryId, long newRepositoryId, String fileName) throws SystemException
BaseStore
updateFile
in interface Store
updateFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repositorynewRepositoryId
- the primary key of the new data repositoryfileName
- the file's name
SystemException
- if a system exception occurredpublic void updateFile(long companyId, long repositoryId, String fileName, String newFileName) throws SystemException
SystemException
public void updateFile(long companyId, long repositoryId, String fileName, String versionLabel, InputStream is) throws SystemException
BaseStore
InputStream
object.
updateFile
in interface Store
updateFile
in class BaseStore
companyId
- the primary key of the companyrepositoryId
- the primary key of the data repository (optionally
CompanyConstants#SYSTEM
)fileName
- the file nameversionLabel
- the file's new version labelis
- the new file's data
SystemException
- if a system exception occurredprotected void cleanUpTempFiles()
protected void cleanUpTempFiles(File file, long lastModified)
protected org.jets3t.service.security.AWSCredentials getAWSCredentials() throws org.jets3t.service.S3ServiceException
org.jets3t.service.S3ServiceException
protected String getFileName(String key)
protected String[] getFileNames(org.jets3t.service.model.S3Object[] s3Objects)
protected String getHeadVersionLabel(long companyId, long repositoryId, String fileName) throws PortalException, org.jets3t.service.S3ServiceException
PortalException
org.jets3t.service.S3ServiceException
protected String getKey(long companyId, long repositoryId)
protected String getKey(long companyId, long repositoryId, String fileName)
protected String getKey(long companyId, long repositoryId, String fileName, String versionLabel)
protected String getNormalizedFileName(String fileName)
protected org.jets3t.service.model.S3Bucket getS3Bucket() throws org.jets3t.service.S3ServiceException
org.jets3t.service.S3ServiceException
protected org.jets3t.service.S3Service getS3Service() throws org.jets3t.service.S3ServiceException
org.jets3t.service.S3ServiceException
protected File getTempFile(org.jets3t.service.model.S3Object s3Object, String fileName) throws IOException, org.jets3t.service.ServiceException
IOException
org.jets3t.service.ServiceException
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |