@ InterfaceAudience . Private protected void addAttachment ( Attachment attachment , String name ) { Map < String , Object > attachments = ( Map < String , Object > ) properties . get ( "_attachments" ) ; if ( attachments == null ) { attachments = new HashMap < String , Object > ( ) ; } attachments . put ( name , attachment ) ; properties . put ( "_attachments" , attachments ) ; if ( attachment != null ) { attachment . setName ( name ) ; } }
Creates or updates an attachment . The attachment data will be written to the database when the revision is saved .