|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portlet.documentlibrary.store.BaseStore
public abstract class BaseStore
The abstract base class for all file store implementations. Most, if not all implementations should extend this class.
| Field Summary |
|---|
| Fields inherited from interface com.liferay.portlet.documentlibrary.store.Store |
|---|
VERSION_DEFAULT |
| Constructor Summary | |
|---|---|
BaseStore()
|
|
| Method Summary | |
|---|---|
abstract void |
addDirectory(long companyId,
long repositoryId,
String dirName)
Adds a directory. |
void |
addFile(long companyId,
long repositoryId,
String fileName,
byte[] bytes)
Adds a file based on a byte array. |
void |
addFile(long companyId,
long repositoryId,
String fileName,
File file)
Adds a file based on a File object. |
abstract void |
addFile(long companyId,
long repositoryId,
String fileName,
InputStream is)
Adds a file based on an InputStream object. |
abstract void |
checkRoot(long companyId)
Ensures company's root directory exists. |
void |
copyFileVersion(long companyId,
long repositoryId,
String fileName,
String fromVersionLabel,
String toVersionLabel)
Creates a new copy of the file version. |
abstract void |
deleteDirectory(long companyId,
long repositoryId,
String dirName)
Deletes a directory. |
abstract void |
deleteFile(long companyId,
long repositoryId,
String fileName)
Deletes a file. |
abstract void |
deleteFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Deletes a file at a particular version. |
File |
getFile(long companyId,
long repositoryId,
String fileName)
Returns the file as a File object. |
File |
getFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns the file as a File object. |
byte[] |
getFileAsBytes(long companyId,
long repositoryId,
String fileName)
Returns the file as a byte array. |
byte[] |
getFileAsBytes(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns the file as a byte array. |
InputStream |
getFileAsStream(long companyId,
long repositoryId,
String fileName)
Returns the file as an InputStream object. |
abstract InputStream |
getFileAsStream(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns the file as an InputStream object. |
abstract String[] |
getFileNames(long companyId,
long repositoryId,
String dirName)
Returns all files of the directory. |
abstract long |
getFileSize(long companyId,
long repositoryId,
String fileName)
Returns the size of the file. |
abstract boolean |
hasDirectory(long companyId,
long repositoryId,
String dirName)
Returns true if the directory exists. |
boolean |
hasFile(long companyId,
long repositoryId,
String fileName)
Returns true if the file exists. |
abstract boolean |
hasFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
Returns true if the file exists. |
protected void |
logFailedDeletion(long companyId,
long repositoryId,
String fileName)
|
protected void |
logFailedDeletion(long companyId,
long repositoryId,
String fileName,
Exception exception)
|
protected void |
logFailedDeletion(long companyId,
long repositoryId,
String fileName,
String versionLabel)
|
protected void |
logFailedDeletion(long companyId,
long repositoryId,
String fileName,
String versionLabel,
Exception cause)
|
void |
move(String srcDir,
String destDir)
Moves an existing directory. |
abstract 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 versionLabel,
byte[] bytes)
Updates a file based on a byte array. |
void |
updateFile(long companyId,
long repositoryId,
String fileName,
String versionLabel,
File file)
Updates a file based on a File object. |
abstract void |
updateFile(long companyId,
long repositoryId,
String fileName,
String versionLabel,
InputStream is)
Updates a file based on an InputStream object. |
void |
updateFileVersion(long companyId,
long repositoryId,
String fileName,
String fromVersionLabel,
String toVersionLabel)
Update's a file version label. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.liferay.portlet.documentlibrary.store.Store |
|---|
getFileNames, updateFile |
| Constructor Detail |
|---|
public BaseStore()
| Method Detail |
|---|
public abstract void addDirectory(long companyId,
long repositoryId,
String dirName)
addDirectory in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)dirName - the directory's name
public void addFile(long companyId,
long repositoryId,
String fileName,
byte[] bytes)
throws PortalException
addFile in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file namebytes - the files's data
PortalException
public void addFile(long companyId,
long repositoryId,
String fileName,
File file)
throws PortalException
File object.
addFile in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file namefile - Name the file name
PortalException
public abstract void addFile(long companyId,
long repositoryId,
String fileName,
InputStream is)
throws PortalException
InputStream object.
addFile in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file nameis - the files's data
PortalExceptionpublic abstract void checkRoot(long companyId)
JCRStore#checkRoot(long).
checkRoot in interface StorecompanyId - the primary key of the company
public void copyFileVersion(long companyId,
long repositoryId,
String fileName,
String fromVersionLabel,
String toVersionLabel)
throws PortalException
This method should be overrided if a more optimized approach can be used
(e.g., FileSystemStore#copyFileVersion(long, long, String, String,
String)).
copyFileVersion in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the original's file namefromVersionLabel - the original file's version labeltoVersionLabel - the new version label
PortalException
public abstract void deleteDirectory(long companyId,
long repositoryId,
String dirName)
deleteDirectory in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)dirName - the directory's name
public abstract void deleteFile(long companyId,
long repositoryId,
String fileName)
deleteFile in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's name
public abstract void deleteFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
deleteFile in interface StorecompanyId - 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
public File getFile(long companyId,
long repositoryId,
String fileName)
throws PortalException
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.
getFile in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's name
File object with the file's name
PortalException
public File getFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
throws PortalException
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 StorecompanyId - 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
public byte[] getFileAsBytes(long companyId,
long repositoryId,
String fileName)
throws PortalException
getFileAsBytes in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's name
PortalException
public byte[] getFileAsBytes(long companyId,
long repositoryId,
String fileName,
String versionLabel)
throws PortalException
getFileAsBytes in interface StorecompanyId - 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
PortalException
public InputStream getFileAsStream(long companyId,
long repositoryId,
String fileName)
throws PortalException
InputStream object.
getFileAsStream in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's name
InputStream object with the file's name
PortalException
public abstract InputStream getFileAsStream(long companyId,
long repositoryId,
String fileName,
String versionLabel)
throws PortalException
InputStream object.
getFileAsStream in interface StorecompanyId - 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
public abstract String[] getFileNames(long companyId,
long repositoryId,
String dirName)
getFileNames in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)dirName - the directory's name
public abstract long getFileSize(long companyId,
long repositoryId,
String fileName)
throws PortalException
getFileSize in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's name
PortalException
public abstract boolean hasDirectory(long companyId,
long repositoryId,
String dirName)
true if the directory exists.
hasDirectory in interface StorecompanyId - 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
otherwise
public boolean hasFile(long companyId,
long repositoryId,
String fileName)
true if the file exists.
hasFile in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's name
true if the file exists; false
otherwise
public abstract boolean hasFile(long companyId,
long repositoryId,
String fileName,
String versionLabel)
true if the file exists.
hasFile in interface StorecompanyId - 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
public void move(String srcDir,
String destDir)
JCRStore#move(String, String).
move in interface StoresrcDir - the original directory's namedestDir - the new directory's name
public abstract void updateFile(long companyId,
long repositoryId,
long newRepositoryId,
String fileName)
throws PortalException
updateFile in interface StorecompanyId - 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
PortalException
public void updateFile(long companyId,
long repositoryId,
String fileName,
String versionLabel,
byte[] bytes)
throws PortalException
updateFile in interface StorecompanyId - 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 labelbytes - the new file's data
PortalException
public void updateFile(long companyId,
long repositoryId,
String fileName,
String versionLabel,
File file)
throws PortalException
File object.
updateFile in interface StorecompanyId - 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 labelfile - Name the file name
PortalException
public abstract void updateFile(long companyId,
long repositoryId,
String fileName,
String versionLabel,
InputStream is)
throws PortalException
InputStream object.
updateFile in interface StorecompanyId - 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
PortalException
public void updateFileVersion(long companyId,
long repositoryId,
String fileName,
String fromVersionLabel,
String toVersionLabel)
throws PortalException
copyFileVersion(long,
long, String, String, String) except that the old file version is
deleted.
updateFileVersion in interface StorecompanyId - the primary key of the companyrepositoryId - the primary key of the data repository (optionally
CompanyConstants.SYSTEM)fileName - the file's namefromVersionLabel - the file's version labeltoVersionLabel - the file's new version label
PortalException
protected void logFailedDeletion(long companyId,
long repositoryId,
String fileName)
protected void logFailedDeletion(long companyId,
long repositoryId,
String fileName,
Exception exception)
protected void logFailedDeletion(long companyId,
long repositoryId,
String fileName,
String versionLabel)
protected void logFailedDeletion(long companyId,
long repositoryId,
String fileName,
String versionLabel,
Exception cause)
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||