Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit b64ed37a authored by Andy Scherzinger's avatar Andy Scherzinger Committed by GitHub
Browse files

Merge pull request #204 from nextcloud/getNote

Add note to file listing
parents 58e861dc e63e69f9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public class WebdavEntry {
    public static final String EXTENDED_PROPERTY_OWNER_DISPLAY_NAME = "owner-display-name";
    public static final String EXTENDED_PROPERTY_UNREAD_COMMENTS = "comments-unread";
    public static final String EXTENDED_PROPERTY_HAS_PREVIEW = "has-preview";
    public static final String EXTENDED_PROPERTY_NOTE = "note";
    public static final String TRASHBIN_FILENAME = "trashbin-filename";
    public static final String TRASHBIN_ORIGINAL_LOCATION = "trashbin-original-location";
    public static final String TRASHBIN_DELETION_TIME = "trashbin-deletion-time";
@@ -87,6 +88,7 @@ public class WebdavEntry {
    private String ownerDisplayName;
    private int unreadCommentsCount;
    private boolean hasPreview;
    private String note = "";

    public enum MountType {INTERNAL, EXTERNAL}

@@ -299,6 +301,12 @@ public class WebdavEntry {
            if (prop != null) {
                trashbinDeletionTimestamp = Long.parseLong((String) prop.getValue());
            }

            // NC note property <nc-note>
            prop = propSet.get(EXTENDED_PROPERTY_NOTE, ncNamespace);
            if (prop != null) {
                note = prop.getValue().toString();
            }
        } else {
            Log_OC.e("WebdavEntry", "General fuckup, no status for webdav response");
        }
@@ -416,6 +424,10 @@ public class WebdavEntry {
        this.hasPreview = hasPreview;
    }
    
    public String getNote() { 
        return note;
    }

    private void resetData() {
        name = uri = contentType = permissions = null;
        remoteId = null;
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ public class WebdavUtils {
        propSet.add(WebdavEntry.EXTENDED_PROPERTY_OWNER_DISPLAY_NAME, ocNamespace);
        propSet.add(WebdavEntry.EXTENDED_PROPERTY_UNREAD_COMMENTS, ocNamespace);
        propSet.add(WebdavEntry.EXTENDED_PROPERTY_HAS_PREVIEW, ncNamespace);
        propSet.add(WebdavEntry.EXTENDED_PROPERTY_NOTE, ncNamespace);

        return propSet;
    }
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
        file.setOwnerDisplayName(we.getOwnerDisplayName());
        file.setUnreadCommentsCount(we.getUnreadCommentsCount());
        file.setHasPreview(we.hasPreview());
        file.setNote(we.getNote());
        
        return file;
    }
+13 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ public class RemoteFile implements Parcelable, Serializable {
    private String ownerDisplayName;
    private int unreadCommentsCount;
    private boolean hasPreview;
    private String note;

    /**
     * Getters and Setters.
@@ -192,6 +193,14 @@ public class RemoteFile implements Parcelable, Serializable {
        this.hasPreview = hasPreview;
    }
    
    public String getNote() {
        return note;
    }
    
    public void setNote(String note) {
        this.note = note;
    }

    public RemoteFile() {
        resetData();
    }
@@ -225,6 +234,7 @@ public class RemoteFile implements Parcelable, Serializable {
        setMountType(we.getMountType());
        setOwnerId(we.getOwnerId());
        setOwnerDisplayName(we.getOwnerDisplayName());
        setNote(we.getNote());
    }

    /**
@@ -244,6 +254,7 @@ public class RemoteFile implements Parcelable, Serializable {
        mIsEncrypted = false;
        ownerId = "";
        ownerDisplayName = "";
        note = "";
    }

    /**
@@ -288,6 +299,7 @@ public class RemoteFile implements Parcelable, Serializable {
        ownerId = source.readString();
        ownerDisplayName = source.readString();
        hasPreview = Boolean.parseBoolean(source.readString());
        note = source.readString();
    }

    @Override
@@ -312,5 +324,6 @@ public class RemoteFile implements Parcelable, Serializable {
        dest.writeString(ownerId);
        dest.writeString(ownerDisplayName);
        dest.writeString(Boolean.toString(hasPreview));
        dest.writeString(note);
    }
}