<commit_before>---
layout: post
title: BLEH
categories: tutorial
tags: [spring-boot]
comments: true
---


{% highlight groovy %}

	@RequestMapping(value="/",method=RequestMethod.POST)
	def uploadImg(@RequestParam("file") MultipartFile file , BindingResult result)
	{
		def thumbnail =new Thumbnail(file :file ,
									 width: ThumbnailConstants.SCALED_WIDTH,
									 height:ThumbnailConstants.SCALED_HEIGHT)
		thumbnailValidator.validate(thumbnail,result)	
		
		try{
			if(!result.hasErrors()){
				  new ResponseEntity(thumbnailService.resizeAndSave(thumbnail),
					  				 HttpStatus.OK)
			}
			else{
				 new ResponseEntity(errorService.listErrors(msgSource,result)
					 			   ,HttpStatus.BAD_REQUEST)
			}
			
		}catch(ex){
			log.error("Unexpected error " ,ex)
			new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR)
			
		}
	}
{% endhighlight %}<commit_msg>Update 2015-11-04-a.md<commit_after>---
layout: post
title: BLEH
categories: tutorial
tags: [spring-boot]
comments: true
---


{% highlight groovy %}

@RequestMapping(value="/",method=RequestMethod.POST)
def uploadImg(@RequestParam("file") MultipartFile file , BindingResult result)
{
	def thumbnail =new Thumbnail(file :file ,
				     width: ThumbnailConstants.SCALED_WIDTH,
				     height:ThumbnailConstants.SCALED_HEIGHT)
	thumbnailValidator.validate(thumbnail,result)	
	
	try{
		if(!result.hasErrors()){
			  new ResponseEntity(thumbnailService.resizeAndSave(thumbnail),
				  				 HttpStatus.OK)
		}
		else{
			 new ResponseEntity(errorService.listErrors(msgSource,result)
				 			   ,HttpStatus.BAD_REQUEST)
		}
		
	}catch(ex){
		log.error("Unexpected error " ,ex)
		new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR)
		
	}
}
	
{% endhighlight %}
{'fraction_non_alphanumeric': 0.11710144927536231, 'fraction_numerical': 0.00463768115942029, 'mean_word_length': 4.076470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4474130', 'n_tokens_mistral': 672, 'n_tokens_neox': 541, 'n_words': 91}