Search in sources :

Example 1 with UploadedFile

use of br.com.caelum.vraptor.observer.upload.UploadedFile in project mamute by caelum.

the class AttachmentRepositoryTest method createAttachment.

private Attachment createAttachment(final String content) {
    final User owner = user("attachment owner", "attachment@owner.local");
    session.save(owner);
    final UploadedFile file = new DefaultUploadedFile(IOUtils.toInputStream(content), "hello.txt", "text/plain", content.length());
    final Attachment attachment = new Attachment(file, owner, "127.0.0.1");
    return attachment;
}
Also used : User(org.mamute.model.User) UploadedFile(br.com.caelum.vraptor.observer.upload.UploadedFile) DefaultUploadedFile(br.com.caelum.vraptor.observer.upload.DefaultUploadedFile) DefaultUploadedFile(br.com.caelum.vraptor.observer.upload.DefaultUploadedFile) Attachment(org.mamute.model.Attachment)

Aggregations

DefaultUploadedFile (br.com.caelum.vraptor.observer.upload.DefaultUploadedFile)1 UploadedFile (br.com.caelum.vraptor.observer.upload.UploadedFile)1 Attachment (org.mamute.model.Attachment)1 User (org.mamute.model.User)1