public Multimap<String,String> processCustomSnippetFiles(List<String> k8sSnippetFilePaths) throws HyscaleException {
        if(k8sSnippetFilePaths == null){
            return null;
        }
        Multimap<String,String> kindVsCustomSnippets = ArrayListMultimap.create();
        String kind = null;
        String yamlSnippet = null;
        for(String snippetFilePath: k8sSnippetFilePaths){
            File snippetFile = new File(snippetFilePath);
            try{
                yamlSnippet = HyscaleFilesUtil.readFileData(snippetFile);
                if(yamlSnippet == null){
                    throw new HyscaleException(CommonErrorCode.FAILED_TO_READ_FILE);
                }
            }catch (HyscaleException e){
                logger.error("Failed to read Custom Snippet file from path {}",snippetFilePath);
                WorkflowLogger.error(ManifestGeneratorActivity.FAILED_TO_READ_CUSTOM_SNIPPETS,snippetFilePath);
                throw new HyscaleException(CommonErrorCode.FAILED_TO_READ_FILE,snippetFilePath);
            }
            try {
                // Validate YAML
                String jsonSnippet =  DataFormatConverter.yamlToJson(yamlSnippet);
                kind = identifyKind(jsonSnippet);
                if(kind == null){
                    throw new HyscaleException(CommonErrorCode.FAILED_TO_READ_FILE);
                }
            }catch(HyscaleException e){
                logger.error("Failed to convert YAML Snippet to json, invalid YAML File {}",yamlSnippet,e);
                WorkflowLogger.error(ManifestGeneratorActivity.INVALID_CUSTOM_SNIPPET,snippetFilePath);
                throw new HyscaleException(CommonErrorCode.FAILED_TO_READ_FILE,snippetFilePath);
            }
            kindVsCustomSnippets.put(kind,yamlSnippet);
        }
        return kindVsCustomSnippets;
    }
This class is responsible for processing Custom K8s Snippets and related operations .

@author Nishanth Panthangi
manifest-generator/generator-services/src/main/java/io/hyscale/generator/services/processor/CustomSnippetsProcessor.java