Skip to content

Instantly share code, notes, and snippets.

@cbmeeks
Created August 2, 2017 20:01
Show Gist options
  • Save cbmeeks/38f4e288b37e74b2a3dbbe842a4a3c75 to your computer and use it in GitHub Desktop.
Save cbmeeks/38f4e288b37e74b2a3dbbe842a4a3c75 to your computer and use it in GitHub Desktop.
SearchAndDestroy.java
public static void main(String[] args) throws IOException {
File rootFolder = new File("c:/tmp/blah/");
File[] files = rootFolder.listFiles();
for (File file : files) {
String name = file.getName().toLowerCase();
if (name.startsWith("patch_")) {
File coreFolder = new File(file.getPath() + "/core");
if (coreFolder.isDirectory()) {
FileUtils.deleteDirectory(coreFolder);
new File(file.getPath() + "/core").mkdirs();
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment