public void ExplodeFiles(BottleExplosionRequest request) { var bottleFile = pathForBottle(request.BottleName); _fileSystem.CreateDirectory(_settings.StagingDirectory); var tempDirectory = FileSystem.Combine(_settings.StagingDirectory, request.BottleName); request.Log.Trace("Exploding bottle {0} to {1}"); _exploder.Explode(bottleFile, tempDirectory, ExplodeOptions.DeleteDestination); var sourceDirectory = FileSystem.Combine(tempDirectory, request.BottleDirectory); _fileSystem.CreateDirectory(request.DestinationDirectory); _fileSystem.FindFiles(sourceDirectory, new FileSet(){ DeepSearch = true, Include = "*.*" }).Each(file => { var destinationFile = FileSystem.Combine(request.DestinationDirectory, file.PathRelativeTo(sourceDirectory)); request.Log.Trace("Copying {0} to {1}", file, destinationFile); _fileSystem.Copy(file, destinationFile); }); }
public void ExplodeFiles(BottleExplosionRequest request) { var bottleFile = pathForBottle(request.BottleName); _fileSystem.CreateDirectory(_settings.StagingDirectory); var tempDirectory = FileSystem.Combine(_settings.StagingDirectory, request.BottleName); request.Log.Trace("Exploding bottle {0} to {1}"); _exploder.Explode(bottleFile, tempDirectory, ExplodeOptions.DeleteDestination); var sourceDirectory = FileSystem.Combine(tempDirectory, request.BottleDirectory); _fileSystem.CreateDirectory(request.DestinationDirectory); _fileSystem.FindFiles(sourceDirectory, new FileSet() { DeepSearch = true, Include = "*.*" }).Each(file => { var destinationFile = FileSystem.Combine(request.DestinationDirectory, file.PathRelativeTo(sourceDirectory)); request.Log.Trace("Copying {0} to {1}", file, destinationFile); _fileSystem.Copy(file, destinationFile); }); }
public bool Equals(BottleExplosionRequest other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.BottleName, BottleName) && Equals(other.BottleDirectory, BottleDirectory) && Equals(other.DestinationDirectory, DestinationDirectory)); }
public bool Equals(BottleExplosionRequest other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.BottleName, BottleName) && Equals(other.BottleDirectory, BottleDirectory) && Equals(other.DestinationDirectory, DestinationDirectory); }