1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Add owner field to remote file

This commit is contained in:
agarcia 2020-06-23 17:46:48 +02:00 committed by Abel García de Prada
parent d164b34fe8
commit 32891e2cf5
2 changed files with 14 additions and 1 deletions

View File

@ -70,11 +70,15 @@ class ReadRemoteFolderOperation(
val mFolderAndFiles = ArrayList<RemoteFile>()
// parse data from remote folder
mFolderAndFiles.add(RemoteFile(propfindMethod.root, AccountUtils.getUserId(mAccount, mContext)))
val remoteFolder = RemoteFile(propfindMethod.root, AccountUtils.getUserId(mAccount, mContext)).apply {
owner = mAccount.name
}
mFolderAndFiles.add(remoteFolder)
// loop to update every child
propfindMethod.members.forEach { resource ->
val file = RemoteFile(resource, AccountUtils.getUserId(mAccount, mContext))
file.owner = mAccount.name
mFolderAndFiles.add(file)
}

View File

@ -91,6 +91,7 @@ public class RemoteFile implements Parcelable, Serializable {
private String mPrivateLink;
private boolean mSharedByLink;
private boolean mSharedWithSharee;
private String mOwner;
public RemoteFile() {
resetData();
@ -305,6 +306,14 @@ public class RemoteFile implements Parcelable, Serializable {
return mSharedByLink;
}
public String getOwner() {
return mOwner;
}
public void setOwner(String owner) {
mOwner = owner;
}
/**
* Used internally. Reset all file properties
*/