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 Stream Create(RelativePath file) { var key = file.GetPathFromWorkingFolder(); bool getResult; PathMapping pm; lock (_mapping) { getResult = _mapping.TryGetValue(key, out pm); } if (getResult && pm.PhysicalPath.StartsWith(OutputFolder)) { try { return(File.Create(Environment.ExpandEnvironmentVariables(pm.PhysicalPath))); } catch (IOException) { } } var pair = CreateRandomFileStream(); pm = new PathMapping(key, Path.Combine(OutputFolder, pair.Item1)); lock (_mapping) { _mapping[key] = pm; } return(pair.Item2); }
public override void Copy(PathMapping sourceFilePath, RelativePath destFilePath) { var key = destFilePath.GetPathFromWorkingFolder(); _mapping[key] = new PathMapping(key, sourceFilePath.PhysicalPath) { Properties = sourceFilePath.Properties, }; }
public override void Copy(PathMapping sourceFilePath, RelativePath destFilePath) { var key = destFilePath.GetPathFromWorkingFolder(); _mapping[key] = new PathMapping(key, sourceFilePath.PhysicalPath) { Properties = sourceFilePath.Properties, }; }
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 override FileStream Create(RelativePath file) { var key = file.GetPathFromWorkingFolder(); PathMapping pm; if (_mapping.TryGetValue(key, out pm) && pm.PhysicalPath.StartsWith(OutputFolder)) { return File.Create(Environment.ExpandEnvironmentVariables(pm.PhysicalPath)); } var pair = CreateRandomFileStream(); _mapping[key] = new PathMapping( key, Path.Combine(OutputFolder, pair.Item1)); return pair.Item2; }
public override Stream Create(RelativePath file) { var key = file.GetPathFromWorkingFolder(); PathMapping pm; if (_mapping.TryGetValue(key, out pm) && pm.PhysicalPath.StartsWith(OutputFolder)) { return(File.Create(Environment.ExpandEnvironmentVariables(pm.PhysicalPath))); } var pair = CreateRandomFileStream(); _mapping[key] = new PathMapping( key, Path.Combine(OutputFolder, pair.Item1)); return(pair.Item2); }
public abstract void Copy(PathMapping sourceFileName, RelativePath destFileName);
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); }