Example #1
0
        internal static FileMetadata GetDefaultFileMetadata(FileInfo fileInfo, FileClass fileClass)
        {
            string       sha512Hash = GetSha512(fileInfo);
            FileMetadata result     = new FileMetadata(
                fileClass,
                FileMetadata.GetDefaultCatgoryForClass(fileClass),
                sha512: sha512Hash);

            return(result);
        }
 private static string GetNugetPublishRelativePath(FileInfo file) => FileMetadata.GetDefaultCatgoryForClass(FileClass.Nuget);
 private static string GetSymbolPackagePublishRelativePath(FileInfo file) => FileMetadata.GetDefaultCatgoryForClass(FileClass.SymbolPackage);
Example #4
0
        public PassThroughLayoutWorker(
            Func <FileInfo, bool> shouldHandleFileFunc,
            Func <FileInfo, string> getRelativePublishPathFromFileFunc,
            Func <FileInfo, FileMetadata> getMetadataForFileFunc,
            string stagingPath)
        {
            _shouldHandleFileFunc = shouldHandleFileFunc ?? (_ => true);

            _getRelativePublishPathFromFileFunc = getRelativePublishPathFromFileFunc ?? (file => Path.Combine(FileMetadata.GetDefaultCatgoryForClass(FileClass.Unknown), file.Name));

            _getMetadataForFileFunc = getMetadataForFileFunc ?? (_ => new FileMetadata(FileClass.Unknown));

            _stagingPath = stagingPath;
        }
Example #5
0
        internal static string GetDefaultPathForFileCategory(FileInfo file, FileClass fileClass)
        {
            string category = FileMetadata.GetDefaultCatgoryForClass(fileClass);

            return(FormattableString.Invariant($"{category}/{file.Name}"));
        }