public void preparePostUpload ( final List < Attachment > attachments ) { tempParts . clear ( ) ; if ( ! attachments . isEmpty ( ) ) { for ( Attachment a : attachments ) { if ( a . getError ( ) != null ) { errorParts . add ( createErrorPart ( a ) ) ; } else { publicParts . add ( createPart ( a ) ) ; } } } }
Replace temporary attachment parts with final parts with upload details or error message .