Skip to content

Commit f68b6fd

Browse files
Added replace existing option to Files.copy in order to fix attachments not being copied properly
1 parent 0332a7f commit f68b6fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/logbook/inmemory/src/main/java/org/phoebus/applications/logbook/InMemoryLogClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public LogEntry set(LogEntry log) {
128128
ext = file.getName().substring(i);
129129
}
130130
File tempFile = File.createTempFile(prefix, ext);
131-
Files.copy(file.toPath(), tempFile.toPath());
131+
Files.copy(file.toPath(), tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
132132
tempFile.deleteOnExit();
133133
String mimeType = URLConnection.guessContentTypeFromName(tempFile.getName());
134134
return AttachmentImpl.of(tempFile, mimeType != null ? mimeType : ext, false);

0 commit comments

Comments
 (0)