use of java.io.FileInputStream in project titan by thinkaurelius.
the class MapReduceIndexJobs method cassandraRepair.
public static ScanMetrics cassandraRepair(String titanPropertiesPath, String indexName, String relationType, String partitionerName) throws InterruptedException, IOException, ClassNotFoundException {
Properties p = new Properties();
FileInputStream fis = null;
try {
fis = new FileInputStream(titanPropertiesPath);
p.load(fis);
return cassandraRepair(p, indexName, relationType, partitionerName);
} finally {
IOUtils.closeQuietly(fis);
}
}
use of java.io.FileInputStream in project titan by thinkaurelius.
the class MapReduceIndexJobs method hbaseRemove.
public static ScanMetrics hbaseRemove(String titanPropertiesPath, String indexName, String relationType) throws InterruptedException, IOException, ClassNotFoundException {
Properties p = new Properties();
FileInputStream fis = null;
try {
fis = new FileInputStream(titanPropertiesPath);
p.load(fis);
return hbaseRemove(p, indexName, relationType);
} finally {
IOUtils.closeQuietly(fis);
}
}
use of java.io.FileInputStream in project Shuttle by timusus.
the class TaggerUtils method copyFile.
static void copyFile(File sourceFile, File destFile) throws IOException {
if (!destFile.getParentFile().exists())
destFile.getParentFile().mkdirs();
if (!destFile.exists()) {
destFile.createNewFile();
}
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
destination = new FileOutputStream(destFile).getChannel();
destination.transferFrom(source, 0, source.size());
} finally {
if (source != null) {
source.close();
}
if (destination != null) {
destination.close();
}
}
}
use of java.io.FileInputStream in project Shuttle by timusus.
the class TaggerUtils method copyFile.
static void copyFile(File sourceFile, FileOutputStream outputStream) throws IOException {
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
destination = outputStream.getChannel();
destination.transferFrom(source, 0, source.size());
} finally {
if (source != null) {
source.close();
}
if (destination != null) {
destination.close();
}
}
}
use of java.io.FileInputStream in project blueprints by tinkerpop.
the class GMLWriterTest method testEncoding.
// Note: this is only a very lightweight test of writer/reader encoding.
// It is known that there are characters which, when written by GMLWriter,
// cause parse errors for GraphMLReader.
// However, this happens uncommonly enough that is not yet known which characters those are.
public void testEncoding() throws Exception {
Graph g = new TinkerGraph();
Vertex v = g.addVertex(1);
v.setProperty("text", "é");
GMLWriter w = new GMLWriter(g);
File f = File.createTempFile("test", "txt");
f.deleteOnExit();
OutputStream out = new FileOutputStream(f);
w.outputGraph(out);
out.close();
Graph g2 = new TinkerGraph();
GMLReader r = new GMLReader(g2);
InputStream in = new FileInputStream(f);
r.inputGraph(in);
in.close();
Vertex v2 = g2.getVertex(1);
assertEquals("é", v2.getProperty("text"));
}
Aggregations