|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.AssociatedFilesManager
public class AssociatedFilesManager
Manager class to deal with associated files
Constructor Summary | |
---|---|
AssociatedFilesManager()
|
Method Summary | |
---|---|
void |
addAssociatedFilesEventListener(AssociatedFilesEventListener listener)
|
File |
addFile(File file,
File associatedFile)
Add a associated File to a File . |
File |
addFile(File file,
File associatedFile,
boolean replace)
Add a associated File to a File . |
File |
addFile(File file,
String associatedFilename)
Add a associated File to a File . |
File |
addFile(File file,
String associatedFilename,
boolean replace)
Add a associated File to a File . |
void |
deleteAllAssociatedFile(File fileDocument)
|
void |
fireAddEvent(File file,
File associatedFile)
|
void |
fireDeleteEvent(File file,
File associatedFile)
|
void |
fireUpdateEvent(File file,
File associatedFile)
|
File |
getAssociatedDirectory(File file)
Returns the File which is the directory in which associated files are stored |
File |
getAssociatedDirectory(FileDocument fileDoc)
Returns the File which is the directory in which associated files are stored |
File |
getAssociatedFile(File file,
String filename)
Returns the File associated with a File with provided name |
List<AssociatedFilesEventListener> |
getAssociatedFilesEventListener()
|
File |
getFile(File file,
String filename)
|
Set<File> |
getFiles(File file)
Retrieve all associated files of the File |
static AssociatedFilesManager |
getInstance()
returns the singleton instance |
File |
getOriginatedFile(File file)
|
void |
removeAllAssociatedFilesEventListener()
|
void |
removeAssociatedFilesEventListener(AssociatedFilesEventListener listener)
|
void |
removeFile(File file,
File associatedFile)
Remove File associated to a File |
void |
removeFile(File file,
String filename)
Remove File associated to a File |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssociatedFilesManager()
Method Detail |
---|
public static AssociatedFilesManager getInstance()
public Set<File> getFiles(File file)
File
file
- the File
. It must not be a directory
File
public File addFile(File file, File associatedFile, boolean replace) throws IOException
File
to a File
.
If the provided File
is not in the correct directory, the file is moved into correct directory and rename if replace is false.
file
- the File
. It must not be a directoryassociatedFile
- the File
replace
- true if a associated file with the same name should be overwrite or not
File
IOException
public File addFile(File file, File associatedFile) throws IOException
File
to a File
.
If the provided File
is not in the correct directory, the file is moved into correct directory and rename if needed.
file
- the File
. It must not be a directoryassociatedFile
- the File
File
IOException
public File addFile(File file, String associatedFilename) throws IOException
File
to a File
.
If the File
already exists in associated directory, it will be overwrite.
file
- the File
. It must not be a directoryassociatedFilename
- the file name
File
IOException
public File addFile(File file, String associatedFilename, boolean replace) throws IOException
File
to a File
.
file
- the File
. It must not be a directoryassociatedFilename
- the file namereplace
- true if a associated file with the same name should be overwrite or not
File
IOException
public void removeFile(File file, String filename)
File
associated to a File
file
- the File
. It must not be a directoryfilename
- the name of the associated filepublic void removeFile(File file, File associatedFile)
File
associated to a File
file
- the File
. It must not be a directoryassociatedFile
- the associated File
public File getAssociatedFile(File file, String filename)
File
associated with a File
with provided name
file
- the File
filename
- the name of the associated associatedFile
File
associated with a File
with provided namepublic File getAssociatedDirectory(FileDocument fileDoc)
File
which is the directory in which associated files are stored
fileDoc
- the FileDocument
File
which is the directory in which associated files are storedpublic File getAssociatedDirectory(File file)
File
which is the directory in which associated files are stored
file
- the File
File
which is the directory in which associated files are storedpublic void fireAddEvent(File file, File associatedFile)
public void fireDeleteEvent(File file, File associatedFile)
public void fireUpdateEvent(File file, File associatedFile)
public void addAssociatedFilesEventListener(AssociatedFilesEventListener listener)
public void removeAssociatedFilesEventListener(AssociatedFilesEventListener listener)
public List<AssociatedFilesEventListener> getAssociatedFilesEventListener()
public void removeAllAssociatedFilesEventListener()
public void deleteAllAssociatedFile(File fileDocument) throws IOException
IOException
public File getFile(File file, String filename)
public File getOriginatedFile(File file)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |