Author: pwang
Date: 2011-03-23 17:12:00 -0700 (Wed, 23 Mar 2011)
New Revision: 24572
Modified:
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/reader/DefaultAttributeTableReader.java
Log:
Add a new constructor to use inputStream
Modified:
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/reader/DefaultAttributeTableReader.java
===================================================================
---
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/reader/DefaultAttributeTableReader.java
2011-03-23 23:36:11 UTC (rev 24571)
+++
core3/table-import-impl/trunk/src/main/java/org/cytoscape/tableimport/internal/reader/DefaultAttributeTableReader.java
2011-03-24 00:12:00 UTC (rev 24572)
@@ -51,7 +51,6 @@
import org.cytoscape.model.CyTable;
import org.cytoscape.tableimport.internal.util.URLUtil;
-
/**
* Basic text table reader for attributes.<br>
*
@@ -83,7 +82,9 @@
// If this is on, import everything using ID as the key.
private boolean importAll = false;
-
+
+ private InputStream is = null;
+
/**
* Constructor.<br>
*
@@ -168,6 +169,20 @@
this.importAll = importAll;
}
+ public DefaultAttributeTableReader(final URL source,
AttributeMappingParameters mapping,
+ final int startLineNumber, final String commentChar, boolean
importAll,
+ InputStream is) {
+ this.source = source;
+ this.mapping = mapping;
+ this.startLineNumber = startLineNumber;
+ this.parser = new AttributeLineParser(mapping);
+ this.commentChar = commentChar;
+ this.importAll = importAll;
+
+ this.is = is;
+ }
+
+
/**
* DOCUMENT ME!
*
@@ -187,12 +202,14 @@
* Read table from the data source.
*/
public void readTable(CyTable table) throws IOException {
- InputStream is = null;
+ //InputStream is = null;
try {
BufferedReader bufRd = null;
- is = URLUtil.getInputStream(source);
+ if (is == null){
+ is = URLUtil.getInputStream(source);
+ }
try {
String line;
int lineCount = 0;
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.