private static void copyPerFileInfo(PerFileSheet perFileSheet, SPDXPackage spdxPackage) throws SpreadsheetException, InvalidSPDXAnalysisException { int firstRow = perFileSheet.getFirstDataRow(); SPDXFile[] files = new SPDXFile[perFileSheet.getNumDataRows()]; for (int i = 0; i < files.length; i++) { files[i] = perFileSheet.getFileInfo(firstRow + i); } spdxPackage.setFiles(files); }
private static void copyPackageInfo(PackageInfoSheet packageInfoSheet, SPDXPackage spdxPackage) throws SpreadsheetException, InvalidSPDXAnalysisException { SPDXPackageInfo info = packageInfoSheet.getPackageInfo(packageInfoSheet.getFirstDataRow()); if (info == null) { throw (new InvalidSPDXAnalysisException("No package info in the spreadsheet")); } spdxPackage.setDeclaredCopyright(info.getDeclaredCopyright()); spdxPackage.setDeclaredLicense(info.getDeclaredLicenses()); spdxPackage.setDeclaredName(info.getDeclaredName()); spdxPackage.setDescription(info.getDescription()); spdxPackage.setConcludedLicenses(info.getConcludedLicense()); spdxPackage.setLicenseInfoFromFiles(info.getLicensesFromFiles()); spdxPackage.setLicenseComment(info.getLicenseComments()); spdxPackage.setVerificationCode(info.getPackageVerification()); spdxPackage.setFileName(info.getFileName()); spdxPackage.setSha1(info.getSha1()); spdxPackage.setShortDescription(info.getShortDescription()); spdxPackage.setSourceInfo(info.getSourceInfo()); spdxPackage.setDownloadUrl(info.getUrl()); if (info.getVersionInfo() != null && !info.getVersionInfo().isEmpty()) { spdxPackage.setVersionInfo(info.getVersionInfo()); } if (info.getOriginator() != null && !info.getOriginator().isEmpty()) { spdxPackage.setOriginator(info.getOriginator()); } if (info.getSupplier() != null && !info.getSupplier().isEmpty()) { spdxPackage.setSupplier(info.getSupplier()); } }
/**