- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 42 of file Attachments.java.
◆ banRestricted()
Attachments org.turro.attach.search.Attachments.banRestricted |
( |
| ) |
|
◆ from()
static Attachments org.turro.attach.search.Attachments.from |
( |
String |
path | ) |
|
|
static |
◆ get()
List<Attachment> org.turro.attach.search.Attachments.get |
( |
| ) |
|
Definition at line 65 of file Attachments.java.
66 return SqlClause.select(
"a").from(
"Attachment a")
68 .equal(
"a.path", path)
69 .or().startsWith(
"a.path", path +
"/")
72 .and().isTrue(
"a.publishable")
74 .startIf(banRestricted)
75 .and().not().contains(
"a.path",
"#")
77 .orderBy(
"a.modification")
79 .resultList(Attachment.class);
◆ getAllPaths()
static Set<String> org.turro.attach.search.Attachments.getAllPaths |
( |
String |
root | ) |
|
|
static |
Definition at line 121 of file Attachments.java.
122 try(Stream<String> stream = SqlClause.select(
"distinct a.path").from(
"Attachment a")
123 .where().startsWith(
"a.path",
"/" + root +
"/")
125 .stream(String.class)) {
126 return new HashSet<>(
127 stream.map(path -> Path.pathFrom(path).getTill(2))
◆ getTree()
PathTree org.turro.attach.search.Attachments.getTree |
( |
| ) |
|
Definition at line 82 of file Attachments.java.
83 return PathTree.fromObjects(SqlClause.select(
"a").from(
"Attachment a")
85 .equal(
"a.path", path)
86 .or().startsWith(
"a.path", path +
"/")
89 .and().isTrue(
"a.publishable")
91 .startIf(banRestricted)
92 .and().not().contains(
"a.path",
"#")
93 .and().isFalse(
"a.requiresAcceptance")
94 .and().isFalse(
"a.watermark")
96 .orderBy(
"a.modification")
98 .stream(Attachment.class)
100 return PathObject.from(
101 a.getRelativePath(path) +
"/" + a.getFileName(),
102 new AttachmentNode(a.getId(), a.getFileSize(), a.getModification(), a.getFileExtension()));
104 .toList(),
new AttachmentNode(
null, 0,
null,
null));
◆ onlyPublic()
Attachments org.turro.attach.search.Attachments.onlyPublic |
( |
| ) |
|
◆ remove()
void org.turro.attach.search.Attachments.remove |
( |
| ) |
|
Definition at line 49 of file Attachments.java.
50 SqlClause.delete(
"Attachment")
53 .or().startsWith(
"path", path +
"/")
56 .and().isTrue(
"publishable")
58 .startIf(banRestricted)
59 .and().not().contains(
"path",
"#")
◆ toFolder()
void org.turro.attach.search.Attachments.toFolder |
( |
Folder |
folder | ) |
|
Definition at line 44 of file Attachments.java.
46 get().forEach(a -> saveToFile(folder, a));
The documentation for this class was generated from the following file: