-
-
Notifications
You must be signed in to change notification settings - Fork 278
/
CteraListService.java
53 lines (43 loc) · 1.76 KB
/
CteraListService.java
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
package ch.cyberduck.core.ctera;
/*
* Copyright (c) 2002-2024 iterate GmbH. All rights reserved.
* https://cyberduck.io/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
import ch.cyberduck.core.Path;
import ch.cyberduck.core.dav.DAVListService;
import ch.cyberduck.core.dav.DAVPathEncoder;
import ch.cyberduck.core.exception.BackgroundException;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.github.sardine.DavResource;
import static ch.cyberduck.core.ctera.CteraAttributesFinderFeature.*;
public class CteraListService extends DAVListService {
private final CteraSession session;
public CteraListService(final CteraSession session) {
super(session, new CteraAttributesFinderFeature(session));
this.session = session;
}
@Override
protected List<DavResource> list(final Path directory) throws IOException {
return session.getClient().list(new DAVPathEncoder().encode(directory), 1, Collections.unmodifiableSet(Stream.concat(
Stream.of(GUID_QN), ALL_ACL_QN.stream()
).collect(Collectors.toSet())));
}
@Override
public void preflight(final Path directory) throws BackgroundException {
assumeRole(directory, READPERMISSION);
}
}