Class LocalTriggerManager.ScriptAttachmentBean

  • All Implemented Interfaces:
    mks.frame.triggers.ScriptExposableBean
    Enclosing class:
    LocalTriggerManager

    public static class LocalTriggerManager.ScriptAttachmentBean
    extends LocalTriggerManager.ScriptIdentifiedBean
    implements mks.frame.triggers.ScriptExposableBean
    A bean for an attachment to an issue. A list of the attachment beans is obtained from the issue bean, via the get(Added|Removed)AttachmentBeans method. At this point, the contents of the attachment is assumed to not be populated. The contents are only retrieved if the getContent method is invoked.
    • Constructor Detail

      • ScriptAttachmentBean

        public ScriptAttachmentBean​(int userId,
                                    mks.ci.server.engine.AbstractAttachment a,
                                    int aID,
                                    java.sql.Connection c)
    • Method Detail

      • getExposedName

        public java.lang.String getExposedName()
        Returns the name of this bean that is exposed to the scripting language.
        Specified by:
        getExposedName in interface mks.frame.triggers.ScriptExposableBean
        Specified by:
        getExposedName in class ScriptBaseBean
        Returns:
        the bean name: imAttachmentBean.
      • getContentSize

        public int getContentSize()
        Return the number of bytes in the attachment.
      • getContent

        @Deprecated
        public byte[] getContent()
                          throws mks.frame.triggers.TriggerException
        Deprecated.
        Return the full contents of the attachment in a byte array. Issue attachments have been made larger and this routine may result in an out of memory error.
        Returns:
        the attachment contents as a byte array
        Throws:
        mks.frame.triggers.TriggerException
      • getContent

        public void getContent​(java.io.OutputStream out)
                        throws mks.frame.triggers.TriggerException
        Write the contents of the attachment to the specified output stream.
        Parameters:
        out - The output stream where the contents of the attachment will be written to
        Throws:
        mks.frame.triggers.TriggerException
      • getContentType

        public java.lang.String getContentType()
        Return the type of the attachment in mime format; e.g. a text file will be text/plain, and a binary file will be application/octet-stream
      • getName

        public java.lang.String getName()
        Return the name of the attachment, i.e. the filename it was loaded from.
      • toString

        public java.lang.String toString()
        Returns a summary of this object.
        Overrides:
        toString in class java.lang.Object
      • getSummary

        public java.lang.String getSummary()
        Return the summary for the attachment
      • getCreatedBy

        public java.lang.String getCreatedBy()
        Return the created user of the attachment
      • getAddedDate

        public java.util.Date getAddedDate()
        Return the added date of the attachment