Option <FilePath> InvokedTransfer(Option <FilePath> result, NodeFlow flow, SystemResourceUrn urn) { result.Map( file => C.Notify(Inform($"{flow.SourceNode}:{file.FileName} ==> {flow.TargetNode}")), () => C.Notify(result.Message)); return(result); }
public Option <P> UncFilePath(N n, SystemResourceUrn urn) => from parentUrn in urn.ParentName from subject in Catalog.TryFindSubject(parentUrn) let filename = FileName.Parse(urn.NonSchemeComponents.Last()) select UncShare(n, subject).Share.SharePath + filename;
public Option <CatalogSubject> TryFindSubject(SystemResourceUrn urn) => CatalogState.SubjectUrnIndex.TryFind(urn);
public NodeUncDrive(NodeUncDrive Parent, SystemResourceUrn Urn) : this(new NodeUncShare(Parent.Node, Parent.Root, Parent.Share.SharePath + Urn), Parent.Root, Parent.DriveLetter) { }
public FilePath FilePath(SystemResourceUrn Urn) => SharePath.GetCombinedFilePath(Urn);
Option <FilePath> INodeFileSystemChannel.TransferFile(NodeFlow flow, SystemResourceUrn urn) => InvokedTransfer(TransferFile(flow, urn), flow, urn);
Option <FilePath> TransferFile(NodeFlow flow, SystemResourceUrn urn) => from srcFile in Locator.UncFilePath(flow.SourceNode, urn) from dstFile in Locator.UncFilePath(flow.TargetNode, urn) from result in srcFile.CopyTo(dstFile) select result;