@RequestMapping(value={"/",""},method=RequestMethod.POST) @ResponseBody public RestWrapper update(@ModelAttribute("file") @Valid File file,BindingResult bindingResult,Principal principal){
  RestWrapper restWrapper=null;
  if (bindingResult.hasErrors()) {
    BindingResultError bindingResultError=new BindingResultError();
    return bindingResultError.errorMessage(bindingResult);
  }
  try {
    file.setCreationTS(DateConverter.stringToDate(file.getTableCreationTS()));
    fileDAO.update(file);
    restWrapper=new RestWrapper(file,RestWrapper.OK);
    LOGGER.info("Record with ID:" + file.getBatchId() + " updated in File by User:"+ principal.getName()+ file);
  }
 catch (  MetadataException e) {
    LOGGER.error(e);
    restWrapper=new RestWrapper(e.getMessage(),RestWrapper.ERROR);
  }
  return restWrapper;
}

@ RequestMapping ( value = { "/" , "" } , method = RequestMethod . POST ) @ ResponseBody public RestWrapper update ( @ ModelAttribute ( "file" ) @ Valid File file , BindingResult bindingResult , Principal principal ) { RestWrapper restWrapper = null ; if ( bindingResult . hasErrors ( ) ) { BindingResultError bindingResultError = new BindingResultError ( ) ; return bindingResultError . errorMessage ( bindingResult ) ; } try { file . setCreationTS ( DateConverter . stringToDate ( file . getTableCreationTS ( ) ) ) ; fileDAO . update ( file ) ; restWrapper = new RestWrapper ( file , RestWrapper . OK ) ; LOGGER . info ( "Record with ID:" + file . getBatchId ( ) + " updated in File by User:" + principal . getName ( ) + file ) ; } catch ( MetadataException e ) { LOGGER . error ( e ) ; restWrapper = new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
this method calls proc updatefile and updates the values of the record passed . it also validates the values passed .
