Package com.asual.summer.sample.domain.Technology

Examples of com.asual.summer.sample.domain.Technology.Image


    return new ModelAndView("/edit", model);
  }
 
  @RequestMapping("/image/{value}")
  public void image(@PathVariable("value") String value, HttpServletResponse response) throws IOException {
    Image image = Technology.findImage(value);
    if (image != null) {
      response.setContentLength(image.getBytes().length);
      response.setContentType(image.getContentType());
      response.getOutputStream().write(image.getBytes());
    } else {
      response.setStatus(HttpServletResponse.SC_NOT_FOUND);
    }
    response.getOutputStream().flush();
    response.getOutputStream().close();
View Full Code Here


 
  @Override
  public Image convert(MultipartFile source) {
    if (source.getSize() != 0 && mimeTypes.contains(source.getContentType())) {
      try {
        return new Image(source);
      } catch (Exception e) {
        logger.error(e.getMessage(), e);
      }
    }
    return null;
View Full Code Here

    return new ModelAndView("/edit", model);
  }
 
  @RequestMapping("/image/{value}")
  public void image(@PathVariable("value") String value, HttpServletResponse response) throws IOException {
    Image image = Technology.findImage(value);
    if (image != null) {
      response.setContentLength(image.getBytes().length);
      response.setContentType(image.getContentType());
      response.getOutputStream().write(image.getBytes());
    } else {
      response.setStatus(HttpServletResponse.SC_NOT_FOUND);
    }
    response.getOutputStream().flush();
    response.getOutputStream().close();
View Full Code Here

TOP

Related Classes of com.asual.summer.sample.domain.Technology.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.