BUG 2839: Config: remove dependencies on commons-io
[controller.git] / opendaylight / config / yang-jmx-generator-plugin / src / test / java / org / opendaylight / controller / config / yangjmxgenerator / plugin / AbstractGeneratorTest.java
index 2eae8b6..fb5cd2e 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
 import java.io.File;
-import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.opendaylight.controller.config.yangjmxgenerator.AbstractYangTest;
 
@@ -24,7 +23,21 @@ public abstract class AbstractGeneratorTest extends AbstractYangTest {
 
     @Before
     public void cleanUpDirectory() throws Exception {
-        FileUtils.deleteDirectory(generatorOutputPath);
+        deleteFolder(generatorOutputPath);
+    }
+
+    public void deleteFolder(File folder) {
+        File[] files = folder.listFiles();
+        if (files != null) {
+            for (File f: files) {
+                if (f.isDirectory()) {
+                    deleteFolder(f);
+                } else {
+                    f.delete();
+                }
+            }
+        }
+        folder.delete();
     }
 
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.