Here you can find the source of emptyDerbyTestDirectory(final String derbyTestDirectory)
Parameter | Description |
---|---|
derbyTestDirectory | the root directory of a derby db. |
static public void emptyDerbyTestDirectory(final String derbyTestDirectory)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.File; public class Main { /**//from w w w .ja va 2 s . c o m * Clean out the test directory. This is not fully recursive, since we don't want a run-away delete to wipe out all the contents of the disk by mistake. * * @param derbyTestDirectory the root directory of a derby db. */ static public void emptyDerbyTestDirectory(final String derbyTestDirectory) { // Delete the files in the derbyTestDirectory directory. File tempDirectory = new File(derbyTestDirectory); File[] files = tempDirectory.listFiles(); if (files != null) { for (File file : files) { if (file.isDirectory()) { File[] subFiles = file.listFiles(); for (File subFile : subFiles) { if (subFile.isDirectory()) { File[] subSubFiles = subFile.listFiles(); for (File subSubFile : subSubFiles) { subSubFile.delete(); } } subFile.delete(); } } file.delete(); } } } }