use of java.io.LineNumberReader in project gephi by gephi.
the class ImporterCSV method execute.
@Override
public boolean execute(ContainerLoader container) {
this.container = container;
this.report = new Report();
LineNumberReader lineReader = ImportUtils.getTextReader(reader);
try {
importData(lineReader);
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
try {
lineReader.close();
} catch (IOException ex) {
}
}
return !cancel;
}
use of java.io.LineNumberReader in project gephi by gephi.
the class ImporterDL method execute.
@Override
public boolean execute(ContainerLoader container) {
this.container = container;
this.report = new Report();
LineNumberReader lineReader = ImportUtils.getTextReader(reader);
try {
importData(lineReader);
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
try {
lineReader.close();
} catch (IOException ex) {
}
}
return !cancel;
}
use of java.io.LineNumberReader in project gephi by gephi.
the class ImporterVNA method execute.
@Override
public boolean execute(ContainerLoader container) {
this.container = container;
this.report = new Report();
LineNumberReader lineReader = ImportUtils.getTextReader(reader);
try {
importData(lineReader);
} catch (Exception e) {
report.logIssue(new Issue(e, Issue.Level.SEVERE));
} finally {
try {
lineReader.close();
} catch (IOException ex) {
}
}
return !cancel;
}
use of java.io.LineNumberReader in project gephi by gephi.
the class PaletteManager method loadPalettes.
private static Collection<Palette> loadPalettes(String fileName) throws IOException {
LineNumberReader reader = new LineNumberReader(new InputStreamReader(PaletteManager.class.getResourceAsStream(fileName)));
String line;
List<List<Color>> palettes = new ArrayList<>();
while ((line = reader.readLine()) != null) {
List<Color> palette = new ArrayList<>();
String[] split = line.split(",");
for (String colorStr : split) {
if (!colorStr.isEmpty()) {
palette.add(parseHexColor(colorStr.trim()));
}
}
if (!palette.isEmpty()) {
palettes.add(palette);
}
}
List<Palette> result = new ArrayList<>();
for (List<Color> cls : palettes) {
Palette plt = new Palette(cls.toArray(new Color[0]));
result.add(plt);
}
return result;
}
use of java.io.LineNumberReader in project camel by apache.
the class OrderTest method checkWsdl.
public void checkWsdl(InputStream in) throws Exception {
boolean containsOrderComplexType = false;
LineNumberReader reader = new LineNumberReader(new InputStreamReader(in));
String line;
while ((line = reader.readLine()) != null) {
if (line.contains("complexType name=\"order\"")) {
containsOrderComplexType = true;
// break;
}
}
if (!containsOrderComplexType) {
throw new RuntimeException("WSDL does not contain complex type defintion for class Order");
}
}
Aggregations