Răsfoiți Sursa

Fixed minor issue in config fsh detection

Toby Chui 3 ani în urmă
părinte
comite
9bbb2d76f1
2 a modificat fișierele cu 11 adăugiri și 1 ștergeri
  1. 1 1
      mod/filesystem/config.go
  2. 10 0
      mod/filesystem/fsdef/fsdef.go

+ 1 - 1
mod/filesystem/config.go

@@ -46,7 +46,7 @@ func ValidateOption(options *FileSystemOption) error {
 		return errors.New("This File System Handler UUID is reserved by the system")
 	}
 
-	if !FileExists(options.Path) {
+	if !FileExists(options.Path) && !fsdef.IsNetworkDrive(options.Filesystem) {
 		return errors.New("Path not exists, given: " + options.Path)
 	}
 

+ 10 - 0
mod/filesystem/fsdef/fsdef.go

@@ -35,6 +35,16 @@ var (
 	ErrNullOperation         = errors.New("FS_NULL_OPR")
 )
 
+//Generate a File Manager redirection error message
 func NewRedirectionError(targetVpath string) error {
 	return errors.New("Redirect:" + targetVpath)
 }
+
+//Check if a file system is network drive
+func IsNetworkDrive(fstype string) bool {
+	if fstype == "webdav" || fstype == "ftp" {
+		return true
+	}
+
+	return false
+}