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

(cherry picked from commit 6c5ae0c)
  • Loading branch information
Luke Sikina authored and ramari16 committed Dec 20, 2024
1 parent a11c03a commit 33159a3
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 33159a3

Please sign in to comment.