{"record":{"id":"4e0407e6eda8ea29","repo":"apache/dolphinscheduler","slug":"the-path-is-not-a-directory-resourceabsolutepat","errorCode":null,"errorMessage":"The path is not a directory: ${resourceAbsolutePath}","messagePattern":"The path is not a directory: (.+?)","errorType":"validation","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/resource/AbstractResourceValidator.java","lineNumber":101,"sourceCode":"            throw new ServiceException(\"The file type: \" + fileExtension + \" cannot be fetched\");\n        }\n    }\n\n    public void exceptionResourceNotExists(String resourceAbsolutePath) {\n        if (!storageOperator.exists(resourceAbsolutePath)) {\n            throw new ServiceException(\"Thr resource is not exists: \" + resourceAbsolutePath);\n        }\n    }\n\n    public void exceptionResourceExists(String resourceAbsolutePath) {\n        if (storageOperator.exists(resourceAbsolutePath)) {\n            throw new ServiceException(\"The resource is already exist: \" + resourceAbsolutePath);\n        }\n    }\n\n    public void exceptionResourceIsNotDirectory(String resourceAbsolutePath) {\n        if (StringUtils.isNotEmpty(Files.getFileExtension(resourceAbsolutePath))) {\n            throw new ServiceException(\"The path is not a directory: \" + resourceAbsolutePath);\n        }\n    }\n\n    public void exceptionResourceIsNotFile(String fileAbsolutePath) {\n        if (StringUtils.isEmpty(Files.getFileExtension(fileAbsolutePath))) {\n            throw new ServiceException(\"The path is not a file: \" + fileAbsolutePath);\n        }\n    }\n\n    public void exceptionUserNoResourcePermission(User user, AbstractResourceDto resourceDto) {\n        exceptionUserNoResourcePermission(user, resourceDto.getResourceAbsolutePath());\n    }\n\n    public void exceptionUserNoResourcePermission(User user, String resourceAbsolutePath) {\n        if (user.getUserType() == UserType.ADMIN_USER) {\n            return;\n        }\n        // check if the user have resource tenant permission","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/resource/AbstractResourceValidator.java#L83-L119","documentation":"exceptionResourceIsNotDirectory throws this ServiceException when an operation requires a directory but the given resource path has a non-empty file extension, which the validator uses as a heuristic to decide the path points to a file rather than a directory.","triggerScenarios":"Creating a subdirectory or listing a directory under a path like 'resources/data/notes.txt'; passing a file path where the API expects a parent directory.","commonSituations":"Copy-pasting a file path instead of its parent folder; front-end sending the selected file instead of the directory; directory names that contain dots (e.g. 'v1.2') falsely treated as files.","solutions":["Pass the parent directory path (without a file extension) instead of the file path.","If your directory name contains dots, rename it without a trailing extension-like suffix, as the validator treats any extension as a file.","Verify the request payload field (e.g. currentDir vs fileName) is populated with the directory."],"exampleFix":"// before: passing a file where a directory is required\ncreateDirectory(loginUser, \"/tenant/resources/script.sh\", \"subdir\");\n// after\ncreateDirectory(loginUser, \"/tenant/resources\", \"subdir\");","handlingStrategy":"validation","validationCode":"if (!org.apache.commons.io.FilenameUtils.getExtension(dirPath).isEmpty()) { throw new IllegalArgumentException(\"Expected a directory path: \" + dirPath); }","typeGuard":"boolean isDirectoryPath(String p) { return org.apache.commons.io.FilenameUtils.getExtension(p).isEmpty(); }","tryCatchPattern":null,"preventionTips":["Keep directory names free of dot-suffixed extensions.","Bind UI directory pickers to directory-typed fields only.","Pass parent directories, not files, wherever a directory parameter is expected."],"tags":["resource","directory","path-validation","dolphinscheduler"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}