Exemplo n.º 1
0
        public override void ClearLock(string name)
        {
            if (LockPrefix != null)
            {
                name = LockPrefix + "-" + name;
            }


            var  flag1 = _remoteDirectory.FileExists(name);
            bool flag2;

            if (_remoteDirectory.FileExists(name))
            {
                _remoteDirectory.DeleteFile(name);
                flag2 = true;
            }
            else
            {
                flag2 = false;
            }

            if (flag1 && !flag2)
            {
                throw new IOException("Cannot delete " + name);
            }
        }
Exemplo n.º 2
0
        /// <summary>Returns true if a file with the given name exists. </summary>
        public override bool FileExists(string name)
        {
            CheckDirty();

            if (_inSync)
            {
                try
                {
                    return(CacheDirectory.FileExists(name));
                }
                catch (Exception e)
                {
                    // something isn't quite right, need to re-sync
                    LoggingService.Log(new LogEntry(LogLevel.Error, e, $"Exception thrown while checking file ({name}) exists for {RootFolder}"));
                    SetDirty();
                    return(RemoteDirectory.FileExists(name));

                    ;
                }
            }

            return(RemoteDirectory.FileExists(name));
        }
Exemplo n.º 3
0
 public override bool IsLocked()
 {
     return(_remoteDirectory.FileExists(_lockFile));
 }