e34c9759e4
Signed-off-by: Michael Mayer <michael@photoprism.app>
18 lines
269 B
Go
18 lines
269 B
Go
package webdav
|
|
|
|
import (
|
|
"path"
|
|
"strings"
|
|
)
|
|
|
|
func trimPath(dir string) string {
|
|
if dir = strings.Trim(path.Clean(dir), "/"); dir != "." && dir != ".." {
|
|
return dir
|
|
}
|
|
|
|
return ""
|
|
}
|
|
|
|
func splitPath(dir string) []string {
|
|
return strings.Split(trimPath(dir), "/")
|
|
}
|