Package com.jalios.jcms
Class AssociatedFilesManager
java.lang.Object
com.jalios.jcms.AssociatedFilesManager
Manager class to deal with associated files
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteAllAssociatedFile(File fileDocument) voidfireAddEvent(File file, File associatedFile) voidfireDeleteEvent(File file, File associatedFile) voidfireUpdateEvent(File file, File associatedFile) getAssociatedDirectory(FileDocument fileDoc) Returns theFilewhich is the directory in which associated files are storedgetAssociatedDirectory(File file) Returns theFilewhich is the directory in which associated files are storedgetAssociatedDirectory(File file, boolean createMissingDir) Returns theFilewhich is the directory in which associated files are storedgetAssociatedFile(File file, String filename) Retrieve all associated files of theFilestatic AssociatedFilesManagerreturns the singleton instancegetOriginatedFile(File file) voidvoidvoidremoveFile(File file, File associatedFile) voidremoveFile(File file, String filename)
-
Constructor Details
-
AssociatedFilesManager
public AssociatedFilesManager()
-
-
Method Details
-
getInstance
returns the singleton instance- Returns:
- the singleton instance
-
getFiles
Retrieve all associated files of theFile -
addFile
Add a associatedFileto aFile. If the providedFileis not in the correct directory, the file is moved into correct directory and rename if replace is false.- Parameters:
file- theFile. It must not be a directoryassociatedFile- theFilereplace- true if a associated file with the same name should be overwrite or not- Returns:
- the moved and/or renamed
File - Throws:
IOException- Exception if any problem on file
-
addFile
Add a associatedFileto aFile. If the providedFileis not in the correct directory, the file is moved into correct directory and rename if needed.- Parameters:
file- theFile. It must not be a directoryassociatedFile- theFile- Returns:
- the moved and/or renamed
File - Throws:
IOException- Exception if any problem on file
-
addFile
Add a associatedFileto aFile. If theFilealready exists in associated directory, it will be overwrite.- Parameters:
file- theFile. It must not be a directoryassociatedFilename- the file name- Returns:
- the associated
File - Throws:
IOException- Exception if any problem on file
-
addFile
- Parameters:
file- theFile. It must not be a directoryassociatedFilename- the file namereplace- true if a associated file with the same name should be overwrite or not- Returns:
- the associated
File - Throws:
IOException- Exception if any problem on file
-
removeFile
- Parameters:
file- theFile. It must not be a directoryfilename- the name of the associated file
-
removeFile
-
getAssociatedFile
-
getAssociatedDirectory
Returns theFilewhich is the directory in which associated files are stored- Parameters:
fileDoc- theFileDocument- Returns:
- the
Filewhich is the directory in which associated files are stored
-
getAssociatedDirectory
Returns theFilewhich is the directory in which associated files are stored -
getAssociatedDirectory
Returns theFilewhich is the directory in which associated files are stored -
fireAddEvent
-
fireDeleteEvent
-
fireUpdateEvent
-
addAssociatedFilesEventListener
-
removeAssociatedFilesEventListener
-
getAssociatedFilesEventListener
-
removeAllAssociatedFilesEventListener
public void removeAllAssociatedFilesEventListener() -
deleteAllAssociatedFile
- Throws:
IOException
-
getFile
-
getOriginatedFile
-