@@ -0,0 +1,2066 @@
+-/**%0A - * Copyright (c) 2014 Source Auditor Inc.%0A - *%0A - *   Licensed under the Apache License, Version 2.0 (the %22License%22);%0A - *   you may not use this file except in compliance with the License.%0A - *   You may obtain a copy of the License at%0A - *%0A - *       http://www.apache.org/licenses/LICENSE-2.0%0A - *%0A - *   Unless required by applicable law or agreed to in writing, software%0A - *   distributed under the License is distributed on an %22AS IS%22 BASIS,%0A - *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A - *   See the License for the specific language governing permissions and%0A - *   limitations under the License.%0A - *%0A -*/%0A -package org.spdx.merge;%0A -%0A -import java.util.ArrayList;%0A -import java.util.HashMap;%0A -import java.util.HashSet;%0A -import java.util.Map;%0A -%0A -import org.spdx.rdfparser.InvalidSPDXAnalysisException;%0A -import org.spdx.rdfparser.SPDXDocument;%0A -import org.spdx.rdfparser.SPDXFile;%0A -%0A -/**%0A - * @author gling%0A - *%0A - */%0A -public class SpdxFileInfoMerger %7B%0A -%0A -%09ArrayList%3CSPDXDocument%3E spdxDocList = new ArrayList%3CSPDXDocument%3E();%0A -%09ArrayList%3CSPDXFile%3E alFiles = new ArrayList%3CSPDXFile%3E();%0A -%09HashSet%3CSPDXFile%3E tempSet = new HashSet%3CSPDXFile%3E();%0A -%09SPDXFile%5B%5D tempfileArray;%0A -%09%0A -%09public ArrayList%3CSPDXFile%3E FileInfoMerge%0A -%09%09(HashMap%3CString,SPDXDocument%3E spdxDocMap)throws InvalidSPDXAnalysisException%7B%0A -%09%09    //get all documents and store into a list%0A -%09%09%09for (Map.Entry%3CString, SPDXDocument%3E entry : spdxDocMap.entrySet())%7B%0A -%09%09%09%09spdxDocList.add(entry.getValue());%0A -%09%09%09%7D%0A -%09%09%09//get all file level info. and store into a list%0A -%09        for (int i=0; i %3C spdxDocList.size(); i++)%7B%0A -%09        %09 tempfileArray = spdxDocList.get(i).getSpdxPackage().getFiles();%0A -%09        %09 for (int j = 0; j %3C tempfileArray.length; j++)%7B%0A -%09        %09%09 alFiles.add(j,tempfileArray%5Bj%5D);%0A -%09        %09 %7D%0A -%09        %7D%0A -%09        //use HashSet to remove duplicate file info.%0A -%09        tempSet.addAll(alFiles);%0A -%09        alFiles.clear();%0A -%09        alFiles.addAll(tempSet);%0A -%09             %0A -%09%09%09return alFiles;%09%09%0A -%09%7D%0A -%7D%0A -%0A

Create SpdxFileInfoMerger.java