Skip to content

Commit e96ba95

Browse files
tobiasKaminskyAlvaroBrey
authored andcommitted
reset imageKey
Signed-off-by: tobiasKaminsky <[email protected]>
1 parent 9091783 commit e96ba95

File tree

3 files changed

+63
-11
lines changed

3 files changed

+63
-11
lines changed

library/src/main/java/com/owncloud/android/lib/resources/files/model/FileVersion.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,41 @@ public String getFileName() {
6363
return String.valueOf(modifiedTimestamp / 1000);
6464
}
6565

66+
@Override
67+
public String getMimeType() {
68+
return mimeType;
69+
}
70+
6671
@Override
6772
public String getRemotePath() {
6873
return "";
6974
}
7075

76+
/**
77+
* For file version this is the same as remoteId
78+
*/
7179
@Override
72-
public String getImageKey() {
80+
public long getLocalId() {
81+
return localId;
82+
}
83+
84+
/**
85+
* For file version this is the same as remoteId
86+
*/
87+
@Override
88+
public String getRemoteId() {
7389
return String.valueOf(localId);
7490
}
7591

7692
public boolean isFolder() {
7793
return DIRECTORY.equals(mimeType);
7894
}
7995

96+
@Override
97+
public long getFileLength() {
98+
return 0;
99+
}
100+
80101
public boolean isHidden() {
81102
return getFileName().startsWith(".");
82103
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
package com.owncloud.android.lib.resources.files.model;
22

33
public interface ServerFileInterface {
4-
4+
55
String getFileName();
6-
6+
77
String getMimeType();
88

99
String getRemotePath();
10-
11-
String getImageKey();
12-
10+
11+
long getLocalId();
12+
13+
String getRemoteId();
14+
1315
boolean isFavorite();
14-
16+
1517
boolean isFolder();
16-
18+
1719
long getFileLength();
1820
}

library/src/main/java/com/owncloud/android/lib/resources/trashbin/model/TrashbinFile.java

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
import android.os.Parcel;
2828
import android.os.Parcelable;
2929

30+
import androidx.annotation.VisibleForTesting;
31+
3032
import com.owncloud.android.lib.common.network.WebdavEntry;
3133
import com.owncloud.android.lib.resources.files.FileUtils;
3234
import com.owncloud.android.lib.resources.files.model.ServerFileInterface;
3335

3436
import java.io.Serializable;
3537

36-
import androidx.annotation.VisibleForTesting;
3738
import lombok.Getter;
3839
import lombok.Setter;
3940

@@ -61,6 +62,14 @@ public class TrashbinFile implements Parcelable, Serializable, ServerFileInterfa
6162
private String originalLocation;
6263
private long deletionTimestamp;
6364

65+
/**
66+
* For trashbin this is the same as remoteId
67+
*/
68+
@Override
69+
public long getLocalId() {
70+
return Long.parseLong(getRemoteId());
71+
}
72+
6473
@Override
6574
public boolean isFolder() {
6675
return DIRECTORY.equals(mimeType);
@@ -71,8 +80,28 @@ public boolean isHidden() {
7180
}
7281

7382
@Override
74-
public String getImageKey() {
75-
return remoteId;
83+
public long getFileLength() {
84+
return fileLength;
85+
}
86+
87+
@Override
88+
public String getFileName() {
89+
return fileName;
90+
}
91+
92+
@Override
93+
public String getMimeType() {
94+
return mimeType;
95+
}
96+
97+
@Override
98+
public String getRemotePath() {
99+
return remotePath;
100+
}
101+
102+
@Override
103+
public String getRemoteId() {
104+
return String.valueOf(remoteId);
76105
}
77106

78107
@Override

0 commit comments

Comments
 (0)