/** * Recursively removes any files and subdirectories and then removes the * file (or directory) itself. * * @param f A file or directory. */ private void recursiveDelete(final File f) { if(f.isDirectory()) { final File[] children = f.listFiles(); for(int i=0; i<children.length; i++) { recursiveDelete( children[i] ); } } if(log.isInfoEnabled()) log.info("Removing: "+f); if (!f.delete()) throw new RuntimeException("Could not remove: " + f); }
/** * Data files are placed into a directory named by the test. If the * directory exists, then it is removed before the federation is set up. */ @SuppressWarnings("rawtypes") @Override protected void setUp(final ProxyBigdataSailTestCase testCase) throws Exception { final File dataDir = new File(NAMESPACE); if (dataDir.exists() && dataDir.isDirectory()) { recursiveDelete(dataDir); } client = new EmbeddedClient(getProperties()); fed = client.connect(); }
/** * Recursively removes any files and subdirectories and then removes the * file (or directory) itself. * * @param f A file or directory. */ private void recursiveDelete(final File f) { if(f.isDirectory()) { final File[] children = f.listFiles(); for(int i=0; i<children.length; i++) { recursiveDelete( children[i] ); } } if(log.isInfoEnabled()) log.info("Removing: "+f); if (!f.delete()) throw new RuntimeException("Could not remove: " + f); }
/** * Data files are placed into a directory named by the test. If the * directory exists, then it is removed before the federation is set up. */ @SuppressWarnings("rawtypes") @Override protected void setUp(final ProxyBigdataSailTestCase testCase) throws Exception { final File dataDir = new File(NAMESPACE); if (dataDir.exists() && dataDir.isDirectory()) { recursiveDelete(dataDir); } client = new EmbeddedClient(getProperties()); fed = client.connect(); }