class CodeController {

    @RequestMapping(value = "/clearFiles")
    public ServiceResult clearFiles(@RequestParam(value = "projectId") Integer projectId) {
        try {
            String path = consts.codeConsoleilePath;
            File dir = new File(String.format("%s/%s", path, projectId));
            if (dir.exists()) {
                try {
                    org.apache.commons.io.FileUtils.forceDelete(dir);
                } catch (IOException e) {
                }
            }
            return ServiceResult.success();
        } catch (Throwable e) {
            return ServiceResult.fail(e.getMessage());
        }
    }

}