|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.process.io.file.AbstractFileHandler
public abstract class AbstractFileHandler
Bases of file handler functionnalities whose a lot of these are protected and only usable by
extended classes and by ProcessManagement
services (@see ProcessManagement
).
This class contains the transactionnal mechanism of file system manipulations.
Constructor Summary | |
---|---|
protected |
AbstractFileHandler(ProcessSession session)
Default constructor |
Method Summary | |
---|---|
void |
addDummyHandledFile(DummyHandledFile dummyHandledFile)
Add a dummy file. |
protected void |
checkinSessionWorkingPath()
Checkin session path |
protected void |
deleteSessionWorkingPath()
Delete session path |
protected static boolean |
exists(File file)
Verify if the given file exists |
Set<DummyHandledFile> |
getDummyHandledFiles(String componentInstanceId)
Gets the dummy handled files from a given component instance id. |
protected File |
getExistingFile(FileBasePath basePath,
File file)
If the given file doesn't exist in session path, then the file existing in real path is returned. |
protected File |
getFileForWriting(FileBasePath basePath,
File file)
If the given file doesn't exist in session path, then the file existing in real path is returned. |
protected File |
getFileForWriting(FileBasePath basePath,
File file,
boolean append)
If the given file doesn't exist in session path, then the file existing in real path is returned. |
IOAccess |
getIoAccess()
|
Collection<String> |
getSessionHandledRootPathNames()
Gets handled root directories from the session. |
Collection<String> |
getSessionHandledRootPathNames(boolean skipDeleted)
Gets handled root directories from the session. |
protected Collection<String> |
getSessionHandledRootPathNames(FileBasePath basePath,
boolean skipDeleted)
Gets handled root directories of a base path from the session. |
protected boolean |
isHandledPath(FileBasePath basePath)
Indicates if the given path is handled or not |
protected boolean |
isMarkedToDelete(FileBasePath basePath,
File file)
Indicates if the file will be deleted |
Collection<File> |
listAllSessionHandledRootPathFiles()
Gets handled root directory Files of a base path from the session. |
protected Collection<File> |
listAllSessionHandledRootPathFiles(FileBasePath basePath)
Gets handled root directory Files of a base path from the session. |
protected boolean |
markToDelete(FileBasePath basePath,
File file)
Mark the given file to be deleted. |
void |
removeDummyHandledFile(DummyHandledFile dummyHandledFile)
Remove a dummy file. |
protected long |
sizeOfSessionWorkingPath(FileBasePath basePath,
String... relativeRootPath)
This method calculates the size of files contained in the given relative root path from the session and subtracts from the previous result the size of files marked to be deleted. |
long |
sizeOfSessionWorkingPath(String... relativeRootPath)
This method calculates the size of files contained in the given relative root path from the session and subtracts from the previous result the size of files marked to be deleted. |
protected File |
translateToRealPath(FileBasePath basePath,
File file)
Translate to real. |
protected File |
translateToSessionPath(FileBasePath basePath,
File file)
Translate to session path. |
protected void |
verify(FileBasePath basePath,
File file)
Verify the integrity between handled path and file |
protected void |
verify(FileBasePath basePath,
File file,
boolean isReadOnly)
Verify the integrity between handled path and file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractFileHandler(ProcessSession session)
session
- Method Detail |
---|
protected boolean markToDelete(FileBasePath basePath, File file) throws Exception
basePath
- file
-
Exception
protected boolean isMarkedToDelete(FileBasePath basePath, File file)
basePath
- file
-
protected File translateToRealPath(FileBasePath basePath, File file)
basePath
- file
-
protected File translateToSessionPath(FileBasePath basePath, File file)
basePath
- file
-
protected File getExistingFile(FileBasePath basePath, File file)
basePath
- file
-
protected File getFileForWriting(FileBasePath basePath, File file) throws Exception
basePath
- file
-
Exception
protected File getFileForWriting(FileBasePath basePath, File file, boolean append) throws Exception
basePath
- file
- append
-
Exception
public long sizeOfSessionWorkingPath(String... relativeRootPath)
protected long sizeOfSessionWorkingPath(FileBasePath basePath, String... relativeRootPath)
public Collection<String> getSessionHandledRootPathNames()
public Collection<String> getSessionHandledRootPathNames(boolean skipDeleted)
skipDeleted
-
protected Collection<String> getSessionHandledRootPathNames(FileBasePath basePath, boolean skipDeleted)
basePath
- skipDeleted
-
public Collection<File> listAllSessionHandledRootPathFiles()
protected Collection<File> listAllSessionHandledRootPathFiles(FileBasePath basePath)
basePath
-
protected void deleteSessionWorkingPath()
protected void checkinSessionWorkingPath() throws Exception
Exception
protected void verify(FileBasePath basePath, File file)
basePath
- file
- protected void verify(FileBasePath basePath, File file, boolean isReadOnly)
basePath
- file
- isReadOnly
- protected static boolean exists(File file)
file
-
protected boolean isHandledPath(FileBasePath basePath)
basePath
-
public IOAccess getIoAccess()
public void addDummyHandledFile(DummyHandledFile dummyHandledFile)
dummyHandledFile
- public void removeDummyHandledFile(DummyHandledFile dummyHandledFile)
dummyHandledFile
- public Set<DummyHandledFile> getDummyHandledFiles(String componentInstanceId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |