{"record":{"id":"e5e1f0a27c3a45b7","repo":"apache/maven","slug":"downloaded-file-does-not-exist-temp","errorCode":null,"errorMessage":"Downloaded file does not exist: \" + temp","messagePattern":"Downloaded file does not exist: \" \\+ temp","errorType":"exception","errorClass":"ResourceDoesNotExistException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java","lineNumber":448,"sourceCode":"            throw new TransferFailedException(\"Connection failed: \" + e.getMessage(), e);\n        } catch (AuthenticationException e) {\n            throw new TransferFailedException(\"Authentication failed: \" + e.getMessage(), e);\n        } catch (AuthorizationException e) {\n            throw new TransferFailedException(\"Authorization failed: \" + e.getMessage(), e);\n        } finally {\n            // Remove remaining TransferListener instances (checksum handlers removed in above finally clause)\n            if (downloadMonitor != null) {\n                wagon.removeTransferListener(downloadMonitor);\n            }\n\n            disconnectWagon(wagon);\n\n            releaseWagon(protocol, wagon);\n        }\n\n        if (downloaded) {\n            if (!temp.exists()) {\n                throw new ResourceDoesNotExistException(\"Downloaded file does not exist: \" + temp);\n            }\n\n            // The temporary file is named destination + \".tmp\" and is done this way to ensure\n            // that the temporary file is in the same file system as the destination because the\n            // File.renameTo operation doesn't really work across file systems.\n            // So we will attempt to do a File.renameTo for efficiency and atomicity, if this fails\n            // then we will use a brute force copy and delete the temporary file.\n            if (!temp.renameTo(destination)) {\n                try {\n                    Files.copy(\n                            temp.toPath(),\n                            destination.toPath(),\n                            StandardCopyOption.REPLACE_EXISTING,\n                            StandardCopyOption.COPY_ATTRIBUTES);\n\n                    if (!temp.delete()) {\n                        temp.deleteOnExit();\n                    }","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java#L430-L466","documentation":"Error \"Downloaded file does not exist: \" + temp\" thrown in apache/maven.","triggerScenarios":"Thrown at compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java:448 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}