|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.fopps.model.AbstractItem
|
+--org.fopps.model.Artefact
|
+--org.fopps.model.FileAttachment
Links a feature to a file. The attached file must exists. If the file is removed during program operation, the name is saved and may be restored later.
Config| Field Summary |
| Fields inherited from class org.fopps.model.AbstractItem |
ADDED_EVENT, CHANGE_EVENT, name, REMOVED_EVENT |
| Constructor Summary | |
FileAttachment(java.io.File attachedFile)
|
|
FileAttachment(java.lang.String pName)
Constructor for FileAttachment. |
|
FileAttachment(java.lang.String pName,
java.lang.String pCategory,
java.lang.String pFilename)
Constructor for FileAttachment. |
|
| Method Summary | |
protected void |
applyFile(java.io.File pFile)
Stores name and path from a given file object |
void |
detach()
Unlink attached file. |
Filesize |
fileSize()
Returns the size in a more readable form |
protected void |
findFile()
Searches for the file in the search path, if the the last assigned file disappeared. |
java.io.File |
getAttachedFile()
Returns the attachedFile. |
java.lang.String |
getAttachedFilename()
Returns the name of the attached file |
java.io.File |
getFile()
Returns the corresponding file object of the attachment |
java.lang.String |
getFileName()
Returns the name of the attached file (without any path information) |
java.lang.String |
getFilePath()
Returns the path of the attached file |
static java.lang.String |
getSearchPath()
Returns the search path. |
boolean |
isValid()
Checks, if artefact is still valid. |
void |
setAttachedFile(java.io.File pAttachedFile)
Sets the attachedFile. |
void |
setFilename(java.lang.String pAttachedFilename)
Sets the attachedFilename. |
long |
size()
Returns the size of the attached file. |
java.lang.String |
toString()
|
protected void |
update(java.io.File pNewFile)
Updates attached file. |
| Methods inherited from class org.fopps.model.Artefact |
getCategory, getCategoryName, setCategory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FileAttachment(java.lang.String pName)
throws InvalidArtefactException
pName -
public FileAttachment(java.io.File attachedFile)
throws java.io.IOException,
InvalidArtefactException
public FileAttachment(java.lang.String pName,
java.lang.String pCategory,
java.lang.String pFilename)
throws InvalidArtefactException
pName - pCategory - pFilename - File to attach| Method Detail |
public java.io.File getFile()
protected final void update(java.io.File pNewFile)
throws InvalidArtefactException
pNewFile - New file to attach
InvalidArtefactException - if more than one file matches
protected void findFile()
throws InvalidArtefactException
InvalidArtefactException - if more than one file matchesprotected void applyFile(java.io.File pFile)
public java.lang.String getAttachedFilename()
public void setFilename(java.lang.String pAttachedFilename)
throws InvalidArtefactException
InvalidArtefactExceptionpublic static java.lang.String getSearchPath()
Configpublic java.io.File getAttachedFile()
public void setAttachedFile(java.io.File pAttachedFile)
throws InvalidArtefactException
InvalidArtefactExceptionpublic void detach()
public java.lang.String getFileName()
public java.lang.String getFilePath()
public long size()
public Filesize fileSize()
public boolean isValid()
isValid in class Artefactpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||