{"record":{"id":"01c09a05c2cf9090","repo":"ssssssss-team/spider-flow","slug":"filepath","errorCode":null,"errorMessage":"filePath","messagePattern":"filePath","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"spider-flow-core/src/main/java/org/spiderflow/core/utils/FileUtils.java","lineNumber":36,"sourceCode":"\n    public static String FILENAME_PATTERN = \"[a-zA-Z0-9_\\\\-\\\\|\\\\.\\\\u4e00-\\\\u9fa5]+\";\n\n    /**\n     * 输出指定文件的byte数组\n     * \n     * @param filePath 文件路径\n     * @param os 输出流\n     * @return\n     */\n    public static void writeBytes(String filePath, OutputStream os) throws IOException\n    {\n        FileInputStream fis = null;\n        try\n        {\n            File file = new File(filePath);\n            if (!file.exists())\n            {\n                throw new FileNotFoundException(filePath);\n            }\n            fis = new FileInputStream(file);\n            byte[] b = new byte[1024];\n            int length;\n            while ((length = fis.read(b)) > 0)\n            {\n                os.write(b, 0, length);\n            }\n        }\n        catch (IOException e)\n        {\n            throw e;\n        }\n        finally\n        {\n            if (os != null)\n            {\n                try","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/ssssssss-team/spider-flow/blob/c799cca99c7d064673dc79e6ef06a08bbc0e292d/spider-flow-core/src/main/java/org/spiderflow/core/utils/FileUtils.java#L18-L54","documentation":"FileNotFoundException whose message is the offending path, thrown by FileUtils.writeBytes when new File(filePath).exists() is false. The input at fault is filePath — the file-download/export handler received a path that does not exist on disk (deleted file, wrong working directory, or a path with characters outside FILENAME_PATTERN that was never created).","triggerScenarios":"Thrown at spider-flow-core/src/main/java/org/spiderflow/core/utils/FileUtils.java:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the file path for typos and verify it is absolute or correct relative to the process working directory.","Call new File(filePath).exists() before invoking writeBytes and return a friendly 'file not found' response.","Validate uploaded/stored file names against FILENAME_PATTERN to prevent paths that were never written.","Ensure the file-generation step ran successfully before the download is requested."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c799cca99c7d064673dc79e6ef06a08bbc0e292d","analyzedAt":"2026-09-08T13:47:08.225Z","contentChangedAt":"2026-09-08T13:47:08.225Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}