CmisSync.Lib.FolderLock.FolderLock C# (CSharp) Method

FolderLock() public method

Constructor.
public FolderLock ( string folderPath ) : log4net
folderPath string
return log4net
        public FolderLock(string folderPath)
        {
            try
            {
                //Lock desktop.ini file....
                Logger.Info("Creating folder lock file: " + folderPath);
                lockFilePath = Path.Combine(folderPath, FILENAME);
                if (!File.Exists(lockFilePath))
                {
                    File.WriteAllLines(lockFilePath, new string[0]);
                }
                File.SetAttributes(lockFilePath, File.GetAttributes(lockFilePath) | FileAttributes.Hidden | FileAttributes.System);
                lockFile = File.Open(lockFilePath, FileMode.Open, FileAccess.Read, FileShare.None);
            }
            catch (Exception e)
            {
                Logger.Error("Could not create folder lock: " + lockFilePath, e);
            }
        }