org.squashtest.csp.tm.domain.attachment
Class Attachment

java.lang.Object
  extended by org.squashtest.csp.tm.domain.attachment.Attachment

@Entity
public class Attachment
extends Object


Constructor Summary
Attachment()
           
Attachment(String name)
           
 
Method Summary
 Date getAddedOn()
           
 AttachmentContent getContent()
           
 String getFormattedSize()
           
 String getFormattedSize(Locale locale)
           
 Long getId()
           
 String getName()
           
 String getShortName()
          When dealing with name this is the one you want most of the time
 Long getSize()
           
 String getType()
           
 Attachment hardCopy()
          will perform a deep copy of this Attachment.
 void setAddedOn(Date addedOn)
           
 void setContent(AttachmentContent content)
           
 void setName(String name)
          sets the full name (including extensions).
 void setShortName(String shortName)
          When dealing with names this is the one you want most of the time
 void setSize(Long size)
           
 void setType(String strType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attachment

public Attachment()

Attachment

public Attachment(String name)
Method Detail

getId

public Long getId()

getContent

public AttachmentContent getContent()

setContent

public void setContent(AttachmentContent content)

getName

public String getName()
Returns:
the full name of the file (including extension)

setName

public void setName(String name)
sets the full name (including extensions). The file type will be set on the fly.

Parameters:
String - name

getShortName

@NotBlank
public String getShortName()
When dealing with name this is the one you want most of the time

Returns:
the filename without extension

setShortName

public void setShortName(String shortName)
When dealing with names this is the one you want most of the time

Parameters:
shortName - represents the filename without extension

setType

public final void setType(String strType)

getType

public final String getType()

setAddedOn

public final void setAddedOn(Date addedOn)

getAddedOn

public final Date getAddedOn()

getSize

public Long getSize()

setSize

public void setSize(Long size)

getFormattedSize

public String getFormattedSize()

getFormattedSize

public String getFormattedSize(Locale locale)

hardCopy

public Attachment hardCopy()
will perform a deep copy of this Attachment. All attributes will be duplicated including the content. Note : the properties 'id' and 'addedOn' won't be duplicated and will be automatically set by the system.



Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.