public class AssociatedFilesManager
extends java.lang.Object
Constructor and Description |
---|
AssociatedFilesManager() |
Modifier and Type | Method and Description |
---|---|
void |
addAssociatedFilesEventListener(AssociatedFilesEventListener listener) |
java.io.File |
addFile(java.io.File file,
java.io.File associatedFile)
Add a associated
File to a File . |
java.io.File |
addFile(java.io.File file,
java.io.File associatedFile,
boolean replace)
Add a associated
File to a File . |
java.io.File |
addFile(java.io.File file,
java.lang.String associatedFilename)
Add a associated
File to a File . |
java.io.File |
addFile(java.io.File file,
java.lang.String associatedFilename,
boolean replace)
Add a associated
File to a File . |
void |
deleteAllAssociatedFile(java.io.File fileDocument) |
void |
fireAddEvent(java.io.File file,
java.io.File associatedFile) |
void |
fireDeleteEvent(java.io.File file,
java.io.File associatedFile) |
void |
fireUpdateEvent(java.io.File file,
java.io.File associatedFile) |
java.io.File |
getAssociatedDirectory(java.io.File file)
Returns the
File which is the directory in which associated files are stored |
java.io.File |
getAssociatedDirectory(FileDocument fileDoc)
Returns the
File which is the directory in which associated files are stored |
java.io.File |
getAssociatedFile(java.io.File file,
java.lang.String filename)
Returns the
File associated with a File with provided name |
java.util.List<AssociatedFilesEventListener> |
getAssociatedFilesEventListener() |
java.io.File |
getFile(java.io.File file,
java.lang.String filename) |
java.util.Set<java.io.File> |
getFiles(java.io.File file)
Retrieve all associated files of the
File |
static AssociatedFilesManager |
getInstance()
returns the singleton instance
|
java.io.File |
getOriginatedFile(java.io.File file) |
void |
removeAllAssociatedFilesEventListener() |
void |
removeAssociatedFilesEventListener(AssociatedFilesEventListener listener) |
void |
removeFile(java.io.File file,
java.io.File associatedFile)
Remove
File associated to a File |
void |
removeFile(java.io.File file,
java.lang.String filename)
Remove
File associated to a File |
public static AssociatedFilesManager getInstance()
public java.util.Set<java.io.File> getFiles(java.io.File file)
File
file
- the File
. It must not be a directoryFile
public java.io.File addFile(java.io.File file, java.io.File associatedFile, boolean replace) throws java.io.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 notFile
java.io.IOException
- Exception if any problem on filepublic java.io.File addFile(java.io.File file, java.io.File associatedFile) throws java.io.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
java.io.IOException
- Exception if any problem on filepublic java.io.File addFile(java.io.File file, java.lang.String associatedFilename) throws java.io.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 nameFile
java.io.IOException
- Exception if any problem on filepublic java.io.File addFile(java.io.File file, java.lang.String associatedFilename, boolean replace) throws java.io.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 notFile
java.io.IOException
- Exception if any problem on filepublic void removeFile(java.io.File file, java.lang.String filename)
File
associated to a File
file
- the File
. It must not be a directoryfilename
- the name of the associated filepublic void removeFile(java.io.File file, java.io.File associatedFile)
File
associated to a File
file
- the File
. It must not be a directoryassociatedFile
- the associated File
public java.io.File getAssociatedFile(java.io.File file, java.lang.String filename)
File
associated with a File
with provided namefile
- the File
filename
- the name of the associated associatedFileFile
associated with a File
with provided namepublic java.io.File getAssociatedDirectory(FileDocument fileDoc)
File
which is the directory in which associated files are storedfileDoc
- the FileDocument
File
which is the directory in which associated files are storedpublic java.io.File getAssociatedDirectory(java.io.File file)
File
which is the directory in which associated files are storedfile
- the File
File
which is the directory in which associated files are storedpublic void fireAddEvent(java.io.File file, java.io.File associatedFile)
public void fireDeleteEvent(java.io.File file, java.io.File associatedFile)
public void fireUpdateEvent(java.io.File file, java.io.File associatedFile)
public void addAssociatedFilesEventListener(AssociatedFilesEventListener listener)
public void removeAssociatedFilesEventListener(AssociatedFilesEventListener listener)
public java.util.List<AssociatedFilesEventListener> getAssociatedFilesEventListener()
public void removeAllAssociatedFilesEventListener()
public void deleteAllAssociatedFile(java.io.File fileDocument) throws java.io.IOException
java.io.IOException
public java.io.File getFile(java.io.File file, java.lang.String filename)
public java.io.File getOriginatedFile(java.io.File file)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.