-
-
Notifications
You must be signed in to change notification settings - Fork 199
Expand file tree
/
Copy pathAttachedFile.java
More file actions
61 lines (55 loc) · 1.42 KB
/
AttachedFile.java
File metadata and controls
61 lines (55 loc) · 1.42 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
/*
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby;
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(InputStream content, String fileName, long fileSize) {
super(Mode.ATTACHMENT, content, fileName, fileSize);
}
/**
* Creates a new file attachment.
*
* @param content File content.
* @param fileName Filename.
*/
public AttachedFile(InputStream content, 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(Path file, 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(Path file) throws IOException {
super(Mode.ATTACHMENT, file);
}
}