private void writeFiles ( final StatusUpdateTemplate template , final FormItemList items ) throws Exception { FormFile fileItem ; TemplateFileInfo fileInfo ; for ( String fileIdentifier : items . getFileIdentifiers ( ) ) { fileItem = items . getFile ( fileIdentifier ) ; fileInfo = template . getFiles ( ) . get ( fileIdentifier ) ; if ( fileInfo . getContentType ( ) . equals ( fileItem . getContentType ( ) ) ) { // write the file and store it within the instantiation item final File file = this . writeFile ( fileItem ) ; fileItem . setFile ( file ) ; } else { throw new StatusUpdateInstantiationFailedException ( "file \"" + fileIdentifier + "\" must have content type " + fileInfo . getContentType ( ) ) ; } } }
write the files posted if they are matching to the template targeted