Java Code Examples for com.google.common.io.MoreFiles#deleteDirectoryContents()

The following examples show how to use com.google.common.io.MoreFiles#deleteDirectoryContents() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractCacheBasedTest.java    From lemminx with Eclipse Public License 2.0 5 votes vote down vote up
@AfterEach
public final void clearCache() throws IOException {
	if (Files.exists(TEST_WORK_DIRECTORY)) {
		MoreFiles.deleteDirectoryContents(TEST_WORK_DIRECTORY,RecursiveDeleteOption.ALLOW_INSECURE);
	}
	System.clearProperty(FilesUtils.LEMMINX_WORKDIR_KEY);
	FilesUtils.resetDeployPath();
}
 
Example 2
Source File: TestCaseUtils.java    From airsonic-advanced with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Cleans the AIRSONIC_HOME directory used for tests. (Does not delete the folder itself)
 */
public static void cleanAirsonicHomeForTest() throws IOException {
    Path airsonicHomeDir = Paths.get(airsonicHomePathForTest());
    MoreFiles.deleteDirectoryContents(airsonicHomeDir, RecursiveDeleteOption.ALLOW_INSECURE);
}