public Attachment uploadAttachment(String contentType, File content)
            throws RedmineException, IOException {
        try (InputStream is = new FileInputStream(content)) {
            return uploadAttachment(content.getName(), contentType, is, content.length());
        }
    }
public Attachment uploadAttachment ( String contentType , File content ) throws RedmineException , IOException { try ( InputStream is = new FileInputStream ( content ) ) { return uploadAttachment ( content . getName ( ) , contentType , is , content . length ( ) ) ; } }
Uploads an attachment.

@param contentType
content type of the attachment.
@param content
attachment content stream.
@return attachment content.
@throws RedmineException
if something goes wrong.
@throws IOException
if input cannot be read.