Ejemplo n.º 1
0
        private bool TryToTransformSingleFileSource(SingleFileSource source, FilesList filesList)
        {
            if (!_transformations.ContainsKey(source.Id))
            {
                return(false);
            }

            CopyProcessorTransformation transformation = _transformations[source.Id];

            if ((transformation.Options & CopyProcessorTransformationOptions.SingleFile) == 0)
            {
                return(false);
            }

            LocalPath destinationPath = transformation.DestinationPath;

            PackagedFileInfo sourceFile              = source.ListFiles().ToList().First();
            FullPath         destinationFullPath     = _destinationRootDir.CombineWith(destinationPath);
            FileFullPath     destinationFileFullPath = destinationFullPath.ToFileFullPath();

            filesList.AddFile(new PackagedFileInfo(destinationFileFullPath));
            _copier.Copy(sourceFile.FileFullPath, destinationFileFullPath);

            return(true);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            PackagedFileInfo that = (PackagedFileInfo)obj;

            return(string.Equals(_localPath, that._localPath) && string.Equals(_fileFullPath, that._fileFullPath));
        }
Ejemplo n.º 3
0
        public ICollection <PackagedFileInfo> ListFiles()
        {
            List <PackagedFileInfo> files = new List <PackagedFileInfo>();

            foreach (string fileName in _directoryFilesLister.ListFiles(
                         _directoryPath.ToString(),
                         _recursive, DirectoryFilter))
            {
                FileFullPath fileNameFullPath = new FileFullPath(fileName);
                LocalPath    debasedFileName  = fileNameFullPath.ToFullPath().DebasePath(_directoryPath);

                if (!LoggingHelper.LogIfFilteredOut(fileName, FileFilter, _taskContext, _logFiles))
                {
                    continue;
                }

                PackagedFileInfo packagedFileInfo = new PackagedFileInfo(fileNameFullPath, debasedFileName);
                files.Add(packagedFileInfo);
            }

            return(files);
        }
Ejemplo n.º 4
0
 public void AddFile(PackagedFileInfo packagedFileInfo)
 {
     _files.Add(packagedFileInfo);
 }