We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09e6437 commit d1f797fCopy full SHA for d1f797f
1 file changed
src/main/java/mimeparser/MimeMessageConverter.java
@@ -370,10 +370,12 @@ public String replace(Matcher m) throws Exception {
370
Logger.debug("Found %s attachments", attachments.size());
371
372
if (!attachments.isEmpty()) {
373
- boolean successfullyCreatedAttachmentDir = attachmentDir.mkdirs();
+ if (!attachmentDir.exists()) {
374
+ boolean successfullyCreatedAttachmentDir = attachmentDir.mkdirs();
375
- if (!successfullyCreatedAttachmentDir) {
376
- throw new IllegalStateException("Failed to create attachment directory");
+ if (!successfullyCreatedAttachmentDir) {
377
+ throw new IllegalStateException("Failed to create attachment directory");
378
+ }
379
}
380
381
Logger.info("Extract attachments to %s", attachmentDir.getAbsolutePath());
0 commit comments