diff --git a/src/main/java/org/spdx/tools/SpdxToolsHelper.java b/src/main/java/org/spdx/tools/SpdxToolsHelper.java index 15335a1..3bde34b 100644 --- a/src/main/java/org/spdx/tools/SpdxToolsHelper.java +++ b/src/main/java/org/spdx/tools/SpdxToolsHelper.java @@ -2,7 +2,7 @@ * Copyright (c) 2020 Source Auditor Inc. * * SPDX-License-Identifier: Apache-2.0 - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -42,7 +42,7 @@ /** * Static helper methods for the various tools - * + * * @author Gary O'Neall * */ @@ -51,7 +51,7 @@ public class SpdxToolsHelper { public enum SerFileType { JSON, RDFXML, XML, XLS, XLSX, YAML, TAG } - + static Map EXT_TO_FILETYPE; static { HashMap temp = new HashMap<>(); @@ -64,6 +64,7 @@ public enum SerFileType { temp.put("yaml", SerFileType.YAML); temp.put("tag", SerFileType.TAG); temp.put("spdx", SerFileType.TAG); + temp.put("yml", SerFileType.YAML); EXT_TO_FILETYPE = Collections.unmodifiableMap(temp); } @@ -81,7 +82,7 @@ public static ISerializableModelStore fileTypeToStore(SerFileType fileType) thro case XLSX: return new SpreadsheetStore(new InMemSpdxStore(), SpreadsheetFormatType.XLSX); case XML: return new MultiFormatStore(new InMemSpdxStore(), Format.XML, Verbose.COMPACT); case YAML: return new MultiFormatStore(new InMemSpdxStore(), Format.YAML, Verbose.COMPACT); - default: throw new InvalidSPDXAnalysisException("Unsupporte file type: "+fileType+". Check back later."); + default: throw new InvalidSPDXAnalysisException("Unsupported file type: "+fileType+". Check back later."); } } @@ -118,13 +119,13 @@ public static SerFileType strToFileType(String str) { String strFileType = str.toUpperCase().trim(); return SerFileType.valueOf(strFileType); } - + /** * @param file file containing an SPDX document with the standard file extension for the serialization formats * @return the SPDX document stored in the file * @throws InvalidSPDXAnalysisException * @throws IOException - * @throws InvalidFileNameException + * @throws InvalidFileNameException */ public static SpdxDocument deserializeDocument(File file) throws InvalidSPDXAnalysisException, IOException, InvalidFileNameException { ISerializableModelStore store = fileTypeToStore(fileToFileType(file));