Package org.springframework.data

Examples of org.springframework.data.FileData


  public void saveProfilePicture(Long accountId, byte[] imageBytes) throws IOException {
    assertBytesLength(imageBytes);
    String contentType = guessContentType(imageBytes);
    assertContentType(contentType);
    storage.storeFile(new FileData("profile-pics/" + accountId + "/small.jpg", ImageUtils.scaleImageToWidth(imageBytes, 50), contentType));
    storage.storeFile(new FileData("profile-pics/" + accountId + "/normal.jpg", ImageUtils.scaleImageToWidth(imageBytes, 100), contentType));
    storage.storeFile(new FileData("profile-pics/" + accountId + "/large.jpg", ImageUtils.scaleImageToWidth(imageBytes, 200), contentType));
    jdbcTemplate.update("update Member set pictureSet = true where id = ?", accountId);   
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.FileData

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.