List of usage examples for org.apache.commons.io FileUtils deleteDirectory
public static void deleteDirectory(File directory) throws IOException
From source file:net.sf.jdbcwrappers.nulltype.NullTypeTest.java
@AfterClass public static void destroyDataSource() throws Exception { rawDataSource.setShutdownDatabase("shutdown"); try {/*from w ww . java 2s . c o m*/ rawDataSource.getConnection(); } catch (SQLException ex) { // This always throws an exception; just continue } FileUtils.deleteDirectory(new File("target/testDB")); }
From source file:com.gs.obevo.db.apps.reveng.AseDdlgenRevengTest.java
@Test public void testFullReveng() throws Exception { File outputDir = new File("./target/ddlreveng/execute"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema("dbdeploy01"); args.setInputPath(new File("./src/test/resources/reveng/ddlgen/input/ase-ddlgen-input.txt")); args.setGenerateBaseline(false);//w w w .j a v a 2s . co m args.setOutputPath(outputDir); new AseDdlgenReveng().reveng(args); DirectoryAssert.assertDirectoriesEqual(new File("./src/test/resources/reveng/ddlgen/expected"), outputDir); }
From source file:com.novoda.imageloader.core.file.FileUtilTest.java
@After public void after() throws IOException { FileUtils.deleteDirectory(cacheDir); }
From source file:com.yihaodian.architecture.zkclient.ZkTestSystem.java
private ZkTestSystem() { LOG.info("~~~~~~~~~~~~~~~ starting zk system ~~~~~~~~~~~~~~~"); String baseDir = "build/zkdata"; try {//from w ww .j av a 2 s . c o m FileUtils.deleteDirectory(new File(baseDir)); } catch (IOException e) { throw new RuntimeException(e); } String dataDir = baseDir + "/data"; String logDir = baseDir + "/log"; _zkServer = new ZkServer(dataDir, logDir, mock(IDefaultNameSpace.class), PORT); _zkServer.start(); LOG.info("~~~~~~~~~~~~~~~ zk system started ~~~~~~~~~~~~~~~"); }
From source file:com.leverno.ysbos.harvest.HarvesterTest.java
@Override protected void tearDown() throws Exception { FileUtils.deleteDirectory(new File(rootFolder)); super.tearDown(); }
From source file:com.cip.crane.agent.utils.FileExtractUtilsTest.java
public void TestUnzip() { String path = getAbsolutePath("extract/test.zip"); File file = new File(path); try {//from w ww .j a va 2s . c om FileExtractUtils.unZip(file); File testFile1 = new File(file.getParent() + "/test/test1.txt"); assertTrue(testFile1.exists()); FileUtils.deleteDirectory(new File(file.getParent() + "/test")); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
From source file:ms.dew.devops.kernel.plugin.appkind.frontend_node.FrontendNodeBuildFlow.java
protected void preDockerBuild(FinalProjectConfig config, String flowBasePath) throws IOException { String preparePath = config.getTargetDirectory() + "dew_prepare" + File.separator; FileUtils.deleteDirectory(new File(flowBasePath + "dist")); Files.move(Paths.get(preparePath + "dist"), Paths.get(flowBasePath + "dist"), StandardCopyOption.REPLACE_EXISTING); if (config.getApp().getServerConfig() != null && !config.getApp().getServerConfig().isEmpty()) { Files.write(Paths.get(flowBasePath + "custom.conf"), config.getApp().getServerConfig().getBytes()); } else {//from w w w.j ava 2s.com Files.write(Paths.get(flowBasePath + "custom.conf"), "".getBytes()); } $.file.copyStreamToPath(DevOps.class.getResourceAsStream("/dockerfile/frontend_node/Dockerfile"), flowBasePath + "Dockerfile"); }
From source file:io.fluo.core.impl.MiniIT.java
@Test public void testMini() throws Exception { File dataDir = new File(System.getProperty("user.dir") + "/target/" + MiniIT.class.getSimpleName()); if (dataDir.exists()) { FileUtils.deleteDirectory(dataDir); }//from w w w . ja v a 2s . c o m dataDir.mkdirs(); try { FluoConfiguration config = new FluoConfiguration(); config.setApplicationName("mini"); config.setMiniDataDir(dataDir.getAbsolutePath()); config.setMiniStartAccumulo(true); config.setOraclePort(PortUtils.getRandomFreePort()); try (MiniFluo mini = FluoFactory.newMiniFluo(config)) { try (FluoClient client = FluoFactory.newClient(mini.getClientConfiguration())) { Assert.assertNotNull(client); Assert.assertNotNull(client.newLoaderExecutor()); try (Transaction t = client.newTransaction()) { Assert.assertNotNull(t); t.set(Bytes.of("test"), new Column(Bytes.of("cf"), Bytes.of("cq")), Bytes.of("myval")); t.commit(); } try (Snapshot s = client.newSnapshot()) { Assert.assertNotNull(s); Bytes v = s.get(Bytes.of("test"), new Column(Bytes.of("cf"), Bytes.of("cq"))); Assert.assertEquals(Bytes.of("myval"), v); } } } } finally { FileUtils.deleteDirectory(dataDir); } }
From source file:com.nomsic.randb.persistence.xml.RandbXMLPersistenceProviderTest.java
@Before public void setup() throws IOException { FileUtils.deleteDirectory(new File(TEST_DATA_FOLDER)); provider = new RandbXMLPersistenceProvider(TEST_DATA_FOLDER); }
From source file:de.oppermann.pomutils.VersionReplaceTest.java
@Override protected void setUp() throws Exception { super.setUp(); System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG"); File testTargetResourceFolder = new File("target/testresources/versionReplacer"); FileUtils.deleteDirectory(testTargetResourceFolder); FileUtils.copyDirectory(new File("src/test/resources/versionReplacer"), testTargetResourceFolder); }