summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2012-01-09 17:15:58 (EST)
committerRyan D. Brooks2012-01-09 17:15:58 (EST)
commitf8bc5e3db1cdddef401e9ca7edfbad202e625334 (patch)
tree36fb927780655b89d5c6b25712f817d0e171c806
parentdf90162eaeeaeb3219f42af8ba258acd9011c066 (diff)
downloadorg.eclipse.osee-f8bc5e3db1cdddef401e9ca7edfbad202e625334.zip
org.eclipse.osee-f8bc5e3db1cdddef401e9ca7edfbad202e625334.tar.gz
org.eclipse.osee-f8bc5e3db1cdddef401e9ca7edfbad202e625334.tar.bz2
feature[bgz_368750]: Add method CsvArtifact.getRows()
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java
index 9a5fb87..8cab915 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/CsvArtifact.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.utility;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -81,4 +83,24 @@ public class CsvArtifact {
return generateCsvArtifact(staticId, staticId, "", branch);
}
+ public List<List<String>> getRows(boolean ignoreHeaderRow) throws OseeCoreException {
+ List<List<String>> rows = new ArrayList<List<String>>();
+ String csvData = getCsvData();
+ String[] csvLines = csvData.split("\n");
+
+ int rowIndex = 0;
+ for (String csvLine : csvLines) {
+ if ((ignoreHeaderRow && rowIndex > 0) || !ignoreHeaderRow) {
+ String[] values = csvLine.split(",");
+ List<String> row = new ArrayList<String>();
+ for (String value : values) {
+ value = value.trim();
+ row.add(value);
+ }
+ rows.add(row);
+ }
+ rowIndex++;
+ }
+ return rows;
+ }
}