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 authored and Luke-Sikina committed Dec 3, 2024
1 parent 6035482 commit 6c5ae0c
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 6c5ae0c

Please sign in to comment.