* @param map
* @return Attachment.
*/
public static final Attachment getAttachment( Map<String, Object> map )
{
Attachment attachment = null;
if ( map != null && map.size() > 0 )
{
Object o = map.get( TestLinkResponseParams.id.toString());
if ( o != null )
{
Integer id = Integer.parseInt( o.toString() );
if ( id > 0 )
{
attachment = new Attachment();
attachment.setId( id );
attachment.setFileName( getString(map, TestLinkResponseParams.name.toString()) );
attachment.setFileType( getString(map, TestLinkResponseParams.fileType.toString()) );
attachment.setTitle( getString(map, TestLinkResponseParams.title.toString()) );
// TBD: put the date too...
attachment.setContent( getString(map, TestLinkResponseParams.content.toString()) );
// TBD: description not beign returned
// attachment.setDescription( getString(map, TestLinkResponseParams.description.toString() ) );
// TBD: returning name instead of file_name
// TBD: file size not beign returned