public override Stream Create(RelativePath file) { lock (Manifest) { var entry = FindEntryInManifest(file.RemoveWorkingFolder()); if (entry == null) { throw new InvalidOperationException("File entry not found."); } if (_noRandomFile) { Directory.CreateDirectory( Path.Combine(ManifestFolder, file.RemoveWorkingFolder().GetDirectoryPath())); var result = File.Create(Path.Combine(ManifestFolder, file.RemoveWorkingFolder())); entry.LinkToPath = null; return(result); } else { var pair = CreateRandomFileStream(); entry.LinkToPath = Path.Combine(OutputFolder, pair.Item1); return(pair.Item2); } } }
public PathMapping?FindFile(RelativePath file) { var pp = Path.Combine(_expandedInputFolder, file.RemoveWorkingFolder()); if (!File.Exists(pp)) { return(null); } return(new PathMapping(file, Path.Combine(InputFolder, file.RemoveWorkingFolder())) { Properties = Properties }); }
public override Stream Create(RelativePath file) { var f = Path.Combine(ExpandedOutputFolder, file.RemoveWorkingFolder()); Directory.CreateDirectory(Path.GetDirectoryName(f)); return(File.Create(f)); }
public override void Copy(PathMapping sourceFileName, RelativePath destFileName) { var f = Path.Combine(ExpandedOutputFolder, destFileName.RemoveWorkingFolder()); Directory.CreateDirectory(Path.GetDirectoryName(f)); File.Copy(Environment.ExpandEnvironmentVariables(sourceFileName.PhysicalPath), f); }
public override void Copy(PathMapping sourceFileName, RelativePath destFileName) { lock (Manifest) { var entry = FindEntryInManifest(destFileName.RemoveWorkingFolder()); if (entry == null) { throw new InvalidOperationException("File entry not found."); } var pair = CreateRandomFileStream(); entry.LinkToPath = sourceFileName.PhysicalPath; } }
public override void Copy(PathMapping sourceFileName, RelativePath destFileName) { var dest = Path.Combine(ExpandedOutputFolder, destFileName.RemoveWorkingFolder()); EnsureFolder(Path.GetDirectoryName(dest)); var source = Environment.ExpandEnvironmentVariables(sourceFileName.PhysicalPath); if (!FilePathComparer.OSPlatformSensitiveStringComparer.Equals(source, dest)) { File.Copy(source, dest, true); } File.SetAttributes(dest, FileAttributes.Normal); }
public PathMapping?FindFile(RelativePath file) { OutputFileInfo entry; lock (Manifest) { entry = FindEntryInManifest(file.RemoveWorkingFolder()); } if (entry == null) { return(null); } return(new PathMapping(file, entry.LinkToPath ?? Path.Combine(ManifestFolder, entry.RelativePath))); }
public IEnumerable <string> GetExpectedPhysicalPath(RelativePath file) { OutputFileInfo entry; lock (Manifest) { entry = FindEntryInManifest(file.RemoveWorkingFolder()); } if (entry == null) { return(Enumerable.Empty <string>()); } return(new[] { entry.LinkToPath ?? Path.Combine(ManifestFolder, entry.RelativePath) }); }
public override Stream Create(RelativePath file) { lock (Manifest) { var entry = FindEntryInManifest(file.RemoveWorkingFolder()); if (entry == null) { throw new InvalidOperationException("File entry not found."); } var pair = CreateRandomFileStream(); entry.LinkToPath = Path.Combine(OutputFolder, pair.Item1); return(pair.Item2); } }
public IEnumerable <string> GetExpectedPhysicalPath(RelativePath file) => new[] { Path.Combine(InputFolder, file.RemoveWorkingFolder().ToString()) };