Skip to content

Commit 26a8931

Browse files
authored
Merge pull request #3439 from Peyton-Hill-CLS/fix_3438
Fix in memory log attachments not working.
2 parents 0332a7f + b13d037 commit 26a8931

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.io.InputStream;
2424
import java.net.URLConnection;
2525
import java.nio.file.Files;
26+
import java.nio.file.StandardCopyOption;
2627
import java.time.Instant;
2728
import java.util.Arrays;
2829
import java.util.Collection;
@@ -128,7 +129,7 @@ public LogEntry set(LogEntry log) {
128129
ext = file.getName().substring(i);
129130
}
130131
File tempFile = File.createTempFile(prefix, ext);
131-
Files.copy(file.toPath(), tempFile.toPath());
132+
Files.copy(file.toPath(), tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
132133
tempFile.deleteOnExit();
133134
String mimeType = URLConnection.guessContentTypeFromName(tempFile.getName());
134135
return AttachmentImpl.of(tempFile, mimeType != null ? mimeType : ext, false);

0 commit comments

Comments
 (0)