util.go 530 B

12345678910111213141516171819202122232425262728293031
  1. package main
  2. import (
  3. "strings"
  4. "github.com/studio-b12/gowebdav"
  5. )
  6. //remote 路径
  7. func isExists(client *gowebdav.Client, remote string) bool {
  8. // 检查文件夹是否存在
  9. if _, err := client.Stat(remote); err != nil {
  10. return false
  11. } else {
  12. return true
  13. }
  14. return false
  15. }
  16. //替换换行
  17. func Replace_hh(str string) string {
  18. return strings.Replace(strings.TrimSpace(str), "\n", "", -1)
  19. }
  20. func Replace_path(remotePath string) string {
  21. remotePath = strings.ReplaceAll(remotePath, `\`, `/`)
  22. return remotePath
  23. }