public synchronized void purgeApplication(String appName) {
        File appDir = new File(appsDir, appName);
        if (!FilePathValidator.validateFile(appDir, appsDir)) {
            throw new ApplicationException("Application attempting to create files outside the apps directory");
        }
        try {
            Tools.removeDirectory(appDir);
        } catch (IOException e) {
            throw new ApplicationException("Unable to purge application " + appName, e);
        }
        if (appDir.exists()) {
            throw new ApplicationException("Unable to purge application " + appName);
        }
    }
@Test // (expected = ApplicationException.class)
    public void purgeBadApp() throws IOException {
        aar.purgeApplication("org.foo.BAD");
    }