forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttachedFile.java
More file actions
62 lines (56 loc) · 1.51 KB
/
AttachedFile.java
File metadata and controls
62 lines (56 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
/**
* Represents a file attachment response.
*
* @author edgar
* @since 2.0.0
*/
public class AttachedFile extends FileDownload {
/**
* Creates a new file attachment.
*
* @param content File content.
* @param fileName Filename.
* @param fileSize File size or <code>-1</code> if unknown.
*/
public AttachedFile(@Nonnull InputStream content, @Nonnull String fileName, long fileSize) {
super(Mode.ATTACHMENT, content, fileName, fileSize);
}
/**
* Creates a new file attachment.
*
* @param content File content.
* @param fileName Filename.
*/
public AttachedFile(@Nonnull InputStream content, @Nonnull String fileName) {
super(Mode.ATTACHMENT, content, fileName);
}
/**
* Creates a new file attachment.
*
* @param file File content.
* @param fileName Filename.
* @throws IOException For IO exception while reading file.
*/
public AttachedFile(@Nonnull Path file, @Nonnull String fileName) throws IOException {
super(Mode.ATTACHMENT, file, fileName);
}
/**
* Creates a new file attachment.
*
* @param file File content.
* @throws IOException For IO exception while reading file.
*/
public AttachedFile(@Nonnull Path file) throws IOException {
super(Mode.ATTACHMENT, file);
}
}