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

Fix remote file creation using username instead of display name

This commit is contained in:
davigonz 2018-09-05 13:44:43 +02:00
parent cc612f8712
commit 81f1804917
3 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@ public class ReadRemoteFileOperation extends RemoteOperation<RemoteFile> {
if (status == HttpConstants.HTTP_MULTI_STATUS
|| status == HttpConstants.HTTP_OK) {
final RemoteFile file = new RemoteFile(propfind.getRoot(), client.getAccount().getDisplayName());
final RemoteFile file = new RemoteFile(propfind.getRoot(), client.getCredentials().getUsername());
result = new RemoteOperationResult<>(OK);
result.setData(file);

View File

@ -88,12 +88,12 @@ public class ReadRemoteFolderOperation extends RemoteOperation<ArrayList<RemoteF
// parse data from remote folder
mFolderAndFiles.add(
new RemoteFile(propfindMethod.getRoot(), client.getAccount().getDisplayName())
new RemoteFile(propfindMethod.getRoot(), client.getCredentials().getUsername())
);
// loop to update every child
for (Response resource : propfindMethod.getMembers()) {
RemoteFile file = new RemoteFile(resource, client.getAccount().getDisplayName());
RemoteFile file = new RemoteFile(resource, client.getCredentials().getUsername());
mFolderAndFiles.add(file);
}

View File

@ -193,8 +193,8 @@ public class RemoteFile implements Parcelable, Serializable {
mPrivateLink = null;
}
public RemoteFile(final Response davResource, String displayName) {
this(getRemotePathFromUrl(davResource.getHref(), displayName));
public RemoteFile(final Response davResource, String userName) {
this(getRemotePathFromUrl(davResource.getHref(), userName));
final List<Property> properties = davResource.getProperties();
for(Property property : properties) {