Skip to content

Commit

Permalink
reset imageKey
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
  • Loading branch information
tobiasKaminsky committed Dec 2, 2022
1 parent c10e8eb commit c3d71f8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,41 @@ public String getFileName() {
return String.valueOf(modifiedTimestamp / 1000);
}

@Override
public String getMimeType() {
return mimeType;
}

@Override
public String getRemotePath() {
return "";
}

/**
* For file version this is the same as remoteId
*/
@Override
public String getImageKey() {
public long getLocalId() {
return localId;
}

/**
* For file version this is the same as remoteId
*/
@Override
public String getRemoteId() {
return String.valueOf(localId);
}

public boolean isFolder() {
return DIRECTORY.equals(mimeType);
}

@Override
public long getFileLength() {
return 0;
}

public boolean isHidden() {
return getFileName().startsWith(".");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package com.owncloud.android.lib.resources.files.model;

public interface ServerFileInterface {

String getFileName();

String getMimeType();

String getRemotePath();

String getImageKey();


long getLocalId();

String getRemoteId();

boolean isFavorite();

boolean isFolder();

long getFileLength();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.VisibleForTesting;

import com.owncloud.android.lib.common.network.WebdavEntry;
import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.files.model.ServerFileInterface;

import java.io.Serializable;

import androidx.annotation.VisibleForTesting;
import lombok.Getter;
import lombok.Setter;

Expand Down Expand Up @@ -61,6 +62,14 @@ public class TrashbinFile implements Parcelable, Serializable, ServerFileInterfa
private String originalLocation;
private long deletionTimestamp;

/**
* For trashbin this is the same as remoteId
*/
@Override
public long getLocalId() {
return Long.parseLong(getRemoteId());
}

@Override
public boolean isFolder() {
return DIRECTORY.equals(mimeType);
Expand All @@ -71,8 +80,28 @@ public boolean isHidden() {
}

@Override
public String getImageKey() {
return remoteId;
public long getFileLength() {
return fileLength;
}

@Override
public String getFileName() {
return fileName;
}

@Override
public String getMimeType() {
return mimeType;
}

@Override
public String getRemotePath() {
return remotePath;
}

@Override
public String getRemoteId() {
return String.valueOf(remoteId);
}

@Override
Expand Down

0 comments on commit c3d71f8

Please sign in to comment.