{"record":{"id":"749daada9b3a714e","repo":"dianping/cat","slug":"cant-create-directory-s","errorCode":null,"errorMessage":"Cant' create directory(%s)!","messagePattern":"Cant' create directory\\((.+?)\\)!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"cat-client/src/main/java/com/dianping/cat/support/Files.java","lineNumber":91,"sourceCode":"                  } else {\n                     copyFile(file, new File(to, name));\n                  }\n               }\n            }\n         }\n      }\n\n      public void copyFile(File from, File to) throws IOException {\n         createDir(to.getParentFile());\n\n         IO.INSTANCE.copy(new FileInputStream(from), new FileOutputStream(to), AutoClose.INPUT_OUTPUT);\n         to.setLastModified(from.lastModified());\n      }\n\n      public void createDir(File dir) {\n         if (!dir.exists()) {\n            if (!dir.mkdirs()) {\n               throw new RuntimeException(String.format(\"Cant' create directory(%s)!\", dir));\n            }\n         }\n      }\n\n      public boolean delete(File file) {\n         return delete(file, false);\n      }\n\n      public boolean delete(File file, boolean recursive) {\n         if (file.exists()) {\n            if (file.isFile()) {\n               return file.delete();\n            } else if (file.isDirectory()) {\n               if (recursive) {\n                  File[] children = file.listFiles();\n\n                  if (children != null) {\n                     for (File child : children) {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-client/src/main/java/com/dianping/cat/support/Files.java#L73-L109","documentation":"Error \"Cant' create directory(%s)!\" thrown in dianping/cat.","triggerScenarios":"Triggered when Files directory creation fails because mkdirs() returns false, typically due to missing permissions, a file already existing at the path, or a full/read-only filesystem.","commonSituations":"See trigger scenarios.","solutions":["Create parent directories before calling the file operation, or use a path that already exists.","Check filesystem permissions on the target directory.","Remove a conflicting file at the target path before creating the directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}