mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
webdav: add recursive arg to Client.Readdir
This commit is contained in:
parent
f04c1c9421
commit
fda38c8f93
@ -124,10 +124,13 @@ func (c *Client) Open(name string) (io.ReadCloser, error) {
|
|||||||
return resp.Body, nil
|
return resp.Body, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Readdir(name string) ([]FileInfo, error) {
|
func (c *Client) Readdir(name string, recursive bool) ([]FileInfo, error) {
|
||||||
// TODO: filter out the directory we're listing
|
depth := internal.DepthOne
|
||||||
|
if recursive {
|
||||||
|
depth = internal.DepthInfinity
|
||||||
|
}
|
||||||
|
|
||||||
ms, err := c.ic.Propfind(name, internal.DepthOne, fileInfoPropfind)
|
ms, err := c.ic.Propfind(name, depth, fileInfoPropfind)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user