Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add custom body in PROPFIND Request #521

Open
JulienDidier-PNS opened this issue Sep 5, 2024 · 0 comments
Open

Cannot add custom body in PROPFIND Request #521

JulienDidier-PNS opened this issue Sep 5, 2024 · 0 comments

Comments

@JulienDidier-PNS
Copy link

JulienDidier-PNS commented Sep 5, 2024

Hi,

I'm looking to include a custom body in a PROPFIND request but, unfortunatly, i don't find something like this.

Is there any way to do it or Sardine support only basics property ?

Here is my body in my original request :

<d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
  <d:prop>
    <nc:acl-list />
    <nc:inherited-acl-list />
    <nc:group-folder-id />
  </d:prop>
</d:propfind>

Here is my Sardine request :

// Définir les propriétés à récupérer en utilisant QName
            Set<QName> props = new HashSet<>();

            props.add(new QName("http://***/ns", "acl-list", "nc"));

            String url = "https:/***/remote.php/dav/files/" + nextcloudUser + path;

            List<DavResource> resources = sardine.propfind(url, 0, props);

            for (DavResource res : resources) {
                System.out.println("Resource: " + res.getName());

                // Extracting the custom properties, including ACLs
                res.getCustomProps().forEach((key, value) -> {
                    System.out.println("Property: " + key + " -> " + value);
                });
            }

I'm supposed to receive this type of response :

<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
    <d:response>
        <d:href>/remote.php/dav/files/USER/PATH</d:href>
        <d:propstat>
            <d:prop>
                <nc:acl-list>
                    <nc:acl>
                        <nc:acl-mapping-type>user</nc:acl-mapping-type>
                        <nc:acl-mapping-id>USER-ID</nc:acl-mapping-id>
                        <nc:acl-mapping-display-name>USER-DISPLAY-NAME</nc:acl-mapping-display-name>
                        <nc:acl-mask>MASK</nc:acl-mask>
                        <nc:acl-permissions>PERM</nc:acl-permissions>
                    </nc:acl>
                    <nc:acl>
                        <nc:acl-mapping-type>user</nc:acl-mapping-type>
                        <nc:acl-mapping-id>USER-ID<nc:acl-mapping-id>
                        <nc:acl-mapping-display-name>USER-DISPLAY-NAME</nc:acl-mapping-display-name>
                        <nc:acl-mask>MASK</nc:acl-mask>
                        <nc:acl-permissions>PERM</nc:acl-permissions>
                    </nc:acl>
                </nc:acl-list>
                <nc:inherited-acl-list/>
                <nc:group-folder-id>14</nc:group-folder-id>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>

but my response is :
acl-list -> userUSER-IDUSER-DISPLAY-NAMEMASKPERMuserUSER-IDUSER-DISPLAY-NAMEMASKPERM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant