Ejemplo n.º 1
0
        private FileEntry ResolveSourceFile([NotNull] AbsolutePath sourcePath)
        {
            var sourceResolver = new FileResolver(Root)
            {
                ErrorPathIsVolumeRoot = ErrorFactory.System.DirectoryNotFound
            };

            return(sourceResolver.ResolveExistingFile(sourcePath));
        }
Ejemplo n.º 2
0
        private FileEntry ResolveSourceFile([NotNull] AbsolutePath sourcePath)
        {
            var sourceResolver = new FileResolver(Root)
            {
                ErrorFileFoundAsDirectory     = ErrorFactory.System.FileNotFound,
                ErrorDirectoryFoundAsFile     = ErrorFactory.System.FileNotFound,
                ErrorLastDirectoryFoundAsFile = ErrorFactory.System.FileNotFound,
                ErrorDirectoryNotFound        = ErrorFactory.System.FileNotFound,
                ErrorPathIsVolumeRoot         = ErrorFactory.System.FileNotFound,
                ErrorNetworkShareNotFound     = ErrorFactory.System.FileNotFound
            };

            return(sourceResolver.ResolveExistingFile(sourcePath));
        }
Ejemplo n.º 3
0
        private FileEntry ResolveSourceFile([NotNull] AbsolutePath sourcePath, bool isCopyAfterMoveFailed)
        {
            var sourceResolver = new FileResolver(Container)
            {
                ErrorPathIsVolumeRoot = ErrorFactory.System.DirectoryNotFound
            };

            FileEntry sourceFile = sourceResolver.ResolveExistingFile(sourcePath);

            AssertIsNotExternallyEncrypted(sourceFile, sourcePath, isCopyAfterMoveFailed);
            AssertHasExclusiveAccess(sourceFile);
            AddChangesForSourceFile(sourceFile);

            return(sourceFile);
        }
Ejemplo n.º 4
0
        private FileEntry ResolveExistingFile([NotNull] AbsolutePath sourcePath)
        {
            var resolver = new FileResolver(Container)
            {
                ErrorFileNotFound             = _ => ErrorFactory.System.UnableToFindSpecifiedFile(),
                ErrorFileFoundAsDirectory     = _ => ErrorFactory.System.UnauthorizedAccess(),
                ErrorLastDirectoryFoundAsFile = _ => ErrorFactory.System.DirectoryNotFound(),
                ErrorDirectoryFoundAsFile     = _ => ErrorFactory.System.DirectoryNotFound(),
                ErrorPathIsVolumeRoot         = _ => ErrorFactory.System.UnauthorizedAccess()
            };
            FileEntry file = resolver.ResolveExistingFile(sourcePath);

            AssertFileIsNotReadOnly(file);
            AssertHasExclusiveAccess(file);
            AssertIsNotExternallyEncrypted(file);

            return(file);
        }