本文整理汇总了Java中org.neo4j.io.fs.FileUtils.deleteRecursively方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.deleteRecursively方法的具体用法?Java FileUtils.deleteRecursively怎么用?Java FileUtils.deleteRecursively使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.io.fs.FileUtils
的用法示例。
在下文中一共展示了FileUtils.deleteRecursively方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: KnowledgeGraph
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public KnowledgeGraph(String db_path) {
this.db_path = new String(db_path);
// delete data from previous runs
try {
FileUtils.deleteRecursively(new File(this.db_path));
} catch (IOException e) {
e.printStackTrace();
}
// create a neo4j database
this.graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(this.db_path);
registerShutdownHook(graphDb);
}
示例2: setUp
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
/**
* Setup the database and construct the graph.
*/
@BeforeClass
public static void setUp() {
try {
FileUtils.deleteRecursively(new File(DB_PATH));
nodeFile = Neo4jGraphTest.class.getResourceAsStream("/strains/cluster.node.graph");
edgeFile = Neo4jGraphTest.class.getResourceAsStream("/strains/cluster.edge.graph");
// nodeFile = new File("10_strains_graph/simple_graph.node.graph");
// edgeFile = new File("10_strains_graph/simple_graph.edge.graph");
Iterator<SequenceNode> np = new NodeIterator(new SequenceNodeFactoryImpl(),
new BufferedReader(new InputStreamReader(nodeFile, "UTF-8")));
Iterator<Edge<?>> ep = new EdgeIterator(new BufferedReader(
new InputStreamReader(edgeFile, "UTF-8")));
db = (Neo4jGraph) new Neo4jBatchBuilder(DB_PATH, new AnnotationCollectionImpl())
.constructGraph(np, ep)
.build();
} catch (IOException e) {
e.printStackTrace();
}
}
示例3: NeoDb
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
public NeoDb(String dbPath, long flushInterval, int cacheCapacity) throws IOException {
this.flushInterval = flushInterval;
this.cacheCapacity = cacheCapacity;
File tempStoreDir = new File(dbPath);
FileUtils.deleteRecursively(tempStoreDir);
this.inserter = BatchInserters.inserter(tempStoreDir);
this.indexProvider = new LuceneBatchInserterIndexProvider(this.inserter);
}
示例4: setUp
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
/**
* Setup the database and construct the graph.
* @throws URISyntaxException when the path is incorrect
*/
@BeforeClass
public static void setUp() throws URISyntaxException {
try {
FileUtils.deleteRecursively(new File(DB_PATH));
nodeFile = getNodeFile();
edgeFile = getEdgeFile();
Iterator<SequenceNode> np = new NodeIterator(new SequenceNodeFactoryImpl(),
new BufferedReader(new InputStreamReader(nodeFile, "UTF-8")));
Iterator<Edge<?>> ep = new EdgeIterator(new BufferedReader(
new InputStreamReader(edgeFile, "UTF-8")));
TreeNode phylo = new TreeParser(getTreeFile()).parse();
db = (Neo4jGraph) new Neo4jBatchBuilder(DB_PATH, new AnnotationCollectionImpl(), phylo)
.constructGraph(np, ep)
.build();
} catch (IOException e) {
fail("Couldn't initialize DB");
}
//CHECKSTYLE.OFF: MagicNumber
first = new AnnotationImpl("first", 0, 10, true);
middle = new AnnotationImpl("middle", 5, 25, true);
last = new AnnotationImpl("last", 20, 30, true);
//CHECKSTYLE.ON: MagicNumber
db.addAnnotation(first);
db.addAnnotation(middle);
db.addAnnotation(last);
}
示例5: deleteButtonAction
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
@SuppressWarnings("unused") @FXML
private void deleteButtonAction(ActionEvent a) {
try {
FileUtils.deleteRecursively(new File(dbload.getDatabase()));
databases.remove(dbload.getDatabase());
} catch (Exception e) {
new ExceptionDialog(dblist.getParent(), e, "Failed to delete database.");
}
}
示例6: setUp
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
/**
* Delete old database.
*/
@BeforeClass
public static void setUp() {
try {
FileUtils.deleteRecursively(new File(DB_PATH));
} catch (IOException e) {
e.printStackTrace();
}
}
示例7: setUp
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
/**
* Setup the database and construct the graph.
*/
@BeforeClass
public static void setUp() {
try {
FileUtils.deleteRecursively(new File(DB_PATH));
} catch (IOException e) {
e.printStackTrace();
}
}
示例8: unpackDbFrom
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
private GraphDatabaseService unpackDbFrom( String file ) throws IOException
{
File path = new File( "target/var/zipup" );
FileUtils.deleteRecursively( path );
path.mkdirs();
ZipInputStream zip = new ZipInputStream( getClass().getClassLoader().getResourceAsStream( file ) );
ZipEntry entry = null;
byte[] buffer = new byte[2048];
while ( (entry = zip.getNextEntry()) != null )
{
if ( entry.isDirectory() )
{
new File( path, entry.getName() ).mkdirs();
continue;
}
FileOutputStream fos = new FileOutputStream( new File( path, entry.getName() ) );
BufferedOutputStream bos = new BufferedOutputStream( fos, buffer.length );
int size;
while ( (size = zip.read( buffer, 0, buffer.length )) != -1 )
{
bos.write( buffer, 0, size );
}
bos.flush();
bos.close();
}
return startDatabase( path );
}
示例9: main
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
FileUtils.deleteRecursively(new File(STORE_DIR));
long time = System.currentTimeMillis();
Rules rules = new Rules(); // asList("titles")
new DatabaseImporter("jdbc:mysql://localhost:3306/northwind?user=root", "northwind", STORE_DIR, rules).run();
long delta = (System.currentTimeMillis() - time) / 1000;
String result = importInfo();
System.out.println(result + " in " + delta + " seconds");
}
示例10: main
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
FileUtils.deleteRecursively(new File(STORE_DIR));
long time = System.currentTimeMillis();
new DatabaseImporter("jdbc:mysql://localhost:3306/sakila?user=root", "sakila", STORE_DIR, new Rules()).run();
long delta = (System.currentTimeMillis() - time) / 1000;
String result = importInfo();
System.out.println(result + " in " + delta + " seconds");
}
示例11: main
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
FileUtils.deleteRecursively(new File(STORE_DIR));
StopWatch watch = new StopWatch();
Rules rules = new Rules(); // asList("titles")
new DatabaseImporter("jdbc:mysql://localhost:3306/employees?user=root", "employees", STORE_DIR, rules).run();
watch.lap("import");
System.err.println(watch.stop("import", importInfo()));
}
示例12: main
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
setupDatabase();
FileUtils.deleteRecursively(new File(STORE_DIR));
long time = System.currentTimeMillis();
new DatabaseImporter("jdbc:derby:memory:test", null, STORE_DIR, new Rules()).run();
String result = assertImport();
System.out.println(result + " in " + (System.currentTimeMillis() - time) / 1000 + " seconds");
}
示例13: breakDown
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
@After
public void breakDown() throws IOException{
FileUtils.deleteRecursively(new File(neo4jLocation));
}
示例14: main
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
FileUtils.deleteRecursively(new File("crawler4neo.db"));
SpringApplication.run(Crawler4Neo.class, args);
}
示例15: doBefore
import org.neo4j.io.fs.FileUtils; //导入方法依赖的package包/类
@BeforeClass
public static void doBefore() throws IOException
{
FileUtils.deleteRecursively( new File( "target/test-data/deletion" ) );
db = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newEmbeddedDatabase( "target/test-data/deletion" );
}