Exemplo n.º 1
0
 private void CheckFileExists(MountFilePath file)
 {
     if (!file.Mount.Exists(file.Path) || file.Mount.IsDir(file.Path))
     {
         throw new FileNotFoundException(string.Format("No such file: {0}", file.GetGlobalPath()));
     }
 }
Exemplo n.º 2
0
 private void CheckDirDoesNotExist(MountFilePath file)
 {
     if (file.Mount.Exists(file.Path) && file.Mount.IsDir(file.Path))
     {
         throw new IOException(string.Format("Directory {0} already exists", file.GetGlobalPath()));
     }
 }
Exemplo n.º 3
0
 private void CheckEitherDoesNotExist(MountFilePath file)
 {
     if (file.Mount.Exists(file.Path))
     {
         throw new IOException(string.Format("Path {0} already exists", file.GetGlobalPath()));
     }
 }
Exemplo n.º 4
0
 private void CheckPathsNotOverlapping(MountFilePath src, MountFilePath dst)
 {
     if (src.Mount == dst.Mount)
     {
         if (src.Path.IsParentOf(dst.Path) || dst.Path.IsParentOf(src.Path))
         {
             throw new IOException(string.Format("Cannot move or copy path {0} inside itself", src.GetGlobalPath()));
         }
     }
 }