Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f99657223 | ||
|
|
b12f1c1b33 | ||
|
|
33816041d6 | ||
|
|
31c3cc07c7 | ||
|
|
87bbafc0c0 |
11
client.go
11
client.go
@@ -6,7 +6,9 @@ import (
|
|||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
pathpkg "path"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -84,17 +86,20 @@ func (c *Client) ReadDir(path string) ([]os.FileInfo, error) {
|
|||||||
|
|
||||||
if p := getProps(r, "200"); p != nil {
|
if p := getProps(r, "200"); p != nil {
|
||||||
f := new(File)
|
f := new(File)
|
||||||
f.name = p.Name
|
if ps, err := url.QueryUnescape(r.Href); err == nil {
|
||||||
|
f.name = pathpkg.Base(ps)
|
||||||
|
} else {
|
||||||
|
f.name = p.Name
|
||||||
|
}
|
||||||
f.path = path + f.name
|
f.path = path + f.name
|
||||||
|
f.modified = parseModified(&p.Modified)
|
||||||
|
|
||||||
if p.Type.Local == "collection" {
|
if p.Type.Local == "collection" {
|
||||||
f.path += "/"
|
f.path += "/"
|
||||||
f.size = 0
|
f.size = 0
|
||||||
f.modified = time.Unix(0, 0)
|
|
||||||
f.isdir = true
|
f.isdir = true
|
||||||
} else {
|
} else {
|
||||||
f.size = parseInt64(&p.Size)
|
f.size = parseInt64(&p.Size)
|
||||||
f.modified = parseModified(&p.Modified)
|
|
||||||
f.isdir = false
|
f.isdir = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user