private FileEntry ResolveSourceFile([NotNull] AbsolutePath sourcePath) { var sourceResolver = new FileResolver(Root) { ErrorPathIsVolumeRoot = ErrorFactory.System.DirectoryNotFound }; return(sourceResolver.ResolveExistingFile(sourcePath)); }
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)); }
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); }
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); }