Skip to content

Commit

Permalink
[ALS-7199] Files mved from tomcat's tmp dir to a mounted fs failed to…
Browse files Browse the repository at this point in the history
… delete
  • Loading branch information
Luke Sikina committed Nov 28, 2024
1 parent 6035482 commit b41bc58
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ private boolean moveFile(String destinationName, Path sourceFile, String queryId
try {
LOG.info("Moving query {} to file: {}", queryId, filePath);
makeDirIfDNE(dirPath);
Path result = Files.move(sourceFile, filePath, REPLACE_EXISTING);
Path result = Files.copy(sourceFile, filePath, REPLACE_EXISTING);
// we have to copy and then delete because of how mv works with mounted drives
// (it doesn't work)
Files.delete(sourceFile);
return Files.exists(result);
} catch (IOException e) {
LOG.error("Error moving.", e);
Expand Down

0 comments on commit b41bc58

Please sign in to comment.