ucDeleteAttachment

Purpose

This method deletes the passed in file attachment from the local file system.

Applies To

Attachment Methods

Signature

public boolean ucDeleteAttachment(Attachment attachment) 

Notes

Example

public boolean ucDeleteAttachment(Attachment attachment)
{
    String filepath = attachment.getExternalAttachmentIdent();
    if (filepath == null) { return true; }
    
    File file = new File(filepath);
    
    if (file.delete() != true) {
    	Z.log.writeToLog(Z.log.ERROR, "ucDeleteAttachment: could not delete file " +
            filepath);
    	return false;
    }
    
    return true;
}