CmisSync.Lib.Utils.IsInvalidFolderName C# (CSharp) Method

IsInvalidFolderName() public static method

Check whether a folder name is valid or not.
public static IsInvalidFolderName ( string name ) : bool
name string
return bool
        public static bool IsInvalidFolderName(string name)
        {
            bool ret = invalidFolderNameRegex.IsMatch(name);
            if (ret)
            {
                Logger.Debug(String.Format("The given directory name {0} contains invalid patterns", name));
                return ret;
            }

            return ret;
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// If the given path should be ignored, TRUE will be returned,
 /// otherwise FALSE.
 /// </summary>
 /// <param name="path"></param>
 /// <returns></returns>
 public bool isPathIgnored(string path)
 {
     if (Utils.IsInvalidFolderName(path.Replace("/", "").Replace("\"", "")))
     {
         return(true);
     }
     return(!String.IsNullOrEmpty(ignoredPaths.Find(delegate(string ignore)
     {
         if (String.IsNullOrEmpty(ignore))
         {
             return false;
         }
         return path.StartsWith(ignore);
     })));
 }