Skip to content

Commit

Permalink
Pull request #751: [ROCKSOLID-11653] Fix exporting the EXPORTREADME.t…
Browse files Browse the repository at this point in the history
…xt file when using a baseFolder and rootFolder from the API

Merge in MC/connect from feature/ROCKSOLID-11653-create-readme-file-when-cures-users-export to 4.4.x

* commit 'b183d64bfcafaf759d81a5e9fc254f621e26d3d9':
  [ROCKSOLID-11653] Fix exporting the EXPORTREADME.txt file when using a baseFolder and rootFolder from the API
  • Loading branch information
jdonextgen authored and lmillergithub committed Oct 20, 2023
2 parents 13ef8a5 + b183d64 commit f2d863a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/src/com/mirth/connect/util/MessageExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;

import com.mirth.connect.donkey.model.message.Message;
Expand Down Expand Up @@ -97,8 +98,11 @@ public synchronized int exportMessages(PaginatedList<Message> messageList, Messa
* @return void
*/
public synchronized void writeExportReadMe(MessageWriterOptions options) throws InterruptedException, MessageExportException {
String baseFolder = StringUtils.defaultString(options.getBaseFolder(), System.getProperty("user.dir"));
String rootFolder = FilenameUtils.getAbsolutePath(new File(baseFolder), options.getRootFolder());
InputStream input = this.getClass().getResourceAsStream("EXPORTREADME.txt");
File exportReadMeFile = new File(options.getRootFolder() + File.separator + "EXPORTREADME.txt");
File exportReadMeFile = new File(rootFolder + File.separator + "EXPORTREADME.txt");

try {
FileUtils.copyInputStreamToFile(input, exportReadMeFile);
} catch(Exception e) {
Expand Down

0 comments on commit f2d863a

Please sign in to comment.