Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void startProgram() {
- try {
- deleteWDB(configuration.getPath() + File.separator + "WDB");
- // runtime and other stuff
- } catch (IOException e) {
- // stuff
- }
- }
- public void deleteWDB(String path) {
- File file = new File(path)
- if (file.isDirectory())
- File files[] = file.getFiles() // might be something like listFiles or something with list
- foreach File f in files
- deleteWDB(f.getAbsolutePath()); // should be a function that at least semantically is called this
- } else if (file.exists()) { // or some variation of file validation to make sure its an actual file
- System.out.println(file.getAbsolutePath()); // just for debug, keep this in and next line uncommented until fully bugtested to make sure you dont delete accidental files
- file.delete()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement