-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileOptions.java
More file actions
95 lines (81 loc) · 2.25 KB
/
Copy pathFileOptions.java
File metadata and controls
95 lines (81 loc) · 2.25 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package org.databunker.options;
import java.util.List;
/**
* Options class for storing a file
*/
public class FileOptions {
private final String mimetype;
private final List<String> tags;
private final String finaltime;
private final String slidingtime;
private FileOptions(Builder builder) {
this.mimetype = builder.mimetype;
this.tags = builder.tags;
this.finaltime = builder.finaltime;
this.slidingtime = builder.slidingtime;
}
/**
* MIME type of the file
* @return The MIME type, or null
*/
public String getMimetype() {
return mimetype;
}
/**
* Tags carried by the file. Tags are lowercased and de-duplicated by the
* server, must match ^[a-z0-9][a-z0-9._-]{0,49}$, and at most 16 are kept.
* @return The tag list, or null
*/
public List<String> getTags() {
return tags;
}
/**
* Absolute expiration time for the file
* @return The final time as a string (e.g., "100d", "1h")
*/
public String getFinaltime() {
return finaltime;
}
/**
* Sliding time period for the file
* @return The sliding time as a string (e.g., "30d", "1h")
*/
public String getSlidingtime() {
return slidingtime;
}
/**
* Builder class for FileOptions
*/
public static class Builder {
private String mimetype;
private List<String> tags;
private String finaltime;
private String slidingtime;
public Builder mimetype(String mimetype) {
this.mimetype = mimetype;
return this;
}
public Builder tags(List<String> tags) {
this.tags = tags;
return this;
}
public Builder finaltime(String finaltime) {
this.finaltime = finaltime;
return this;
}
public Builder slidingtime(String slidingtime) {
this.slidingtime = slidingtime;
return this;
}
public FileOptions build() {
return new FileOptions(this);
}
}
/**
* Creates a new builder for FileOptions
* @return A new builder instance
*/
public static Builder builder() {
return new Builder();
}
}