Package com.apress.prospring3.springblog.domain

Examples of com.apress.prospring3.springblog.domain.Comment.addAttachment()


        commentAttachment.setFileData(IOUtils.toByteArray(file.getInputStream()));
        commentAttachment.setContentType(file.getContentType())
       
        Comment comment = commentService.findById(commentId);
        commentAttachment.setComment(comment);
        comment.addAttachment(commentAttachment);
        commentService.save(comment);
      }

      message = new Message("success", "File '" + getFileName(file)
          + "' uploaded successfully");
View Full Code Here


        entryAttachment.setFileData(IOUtils.toByteArray(file.getInputStream()));
        entryAttachment.setContentType(file.getContentType());
       
        Entry entry = entryService.findById(blogId);
        entryAttachment.setEntry(entry);
        entry.addAttachment(entryAttachment);
        entryService.save(entry);
      } else {
        // Construct Attachment object
        CommentAttachment commentAttachment = new CommentAttachment();
        commentAttachment.setFileName(getFileName(file));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.