Skip to content

Commit 7d53d95

Browse files
committed
Register file id provider.
1 parent 35edde4 commit 7d53d95

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package ch.cyberduck.core.features;
2+
3+
/*
4+
* Copyright (c) 2002-2024 iterate GmbH. All rights reserved.
5+
* https://cyberduck.io/
6+
*
7+
* This program is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*/
17+
18+
import ch.cyberduck.core.Path;
19+
import ch.cyberduck.core.exception.BackgroundException;
20+
21+
public class DefaultFileIdProvider implements FileIdProvider {
22+
23+
@Override
24+
public String getFileId(final Path file) throws BackgroundException {
25+
return file.attributes().getFileId();
26+
}
27+
28+
@Override
29+
public void clear() {
30+
// No-op
31+
}
32+
}

ctera/src/main/java/ch/cyberduck/core/ctera/CteraSession.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
import ch.cyberduck.core.features.AttributesFinder;
4343
import ch.cyberduck.core.features.Copy;
4444
import ch.cyberduck.core.features.CustomActions;
45+
import ch.cyberduck.core.features.DefaultFileIdProvider;
4546
import ch.cyberduck.core.features.Delete;
4647
import ch.cyberduck.core.features.Directory;
48+
import ch.cyberduck.core.features.FileIdProvider;
4749
import ch.cyberduck.core.features.Lock;
4850
import ch.cyberduck.core.features.Metadata;
4951
import ch.cyberduck.core.features.Move;
@@ -212,6 +214,9 @@ public <T> T _getFeature(final Class<T> type) {
212214
if(type == Copy.class) {
213215
return (T) new CteraCopyFeature(this);
214216
}
217+
if(type == FileIdProvider.class) {
218+
return (T) new DefaultFileIdProvider();
219+
}
215220
return super._getFeature(type);
216221
}
217222

0 commit comments

Comments
 (0)