|
1 | 1 | package com.marklogic.client.example.cookbook.datamovement; |
2 | 2 |
|
| 3 | +import java.io.File; |
3 | 4 | import java.io.FileWriter; |
4 | 5 | import java.io.IOException; |
5 | 6 | import java.text.DateFormat; |
@@ -59,7 +60,7 @@ public class BulkExportOpticResultsToWriter { |
59 | 60 | private int batchSize = 3; |
60 | 61 | private int threadCount = 3; |
61 | 62 | private String schemaDB = "Schemas"; |
62 | | - private String outputFile = System.getProperty("java.io.tmpdir") + "opticExampleOutput.txt"; |
| 63 | + private String outputFileName = "opticExampleOutput"; |
63 | 64 | private String customerTemplateFile = "/opticExample/customer.tdex"; |
64 | 65 | private String orderTemplateFile = "/opticExample/order.tdex"; |
65 | 66 | private DatabaseClient schemaDBclient = DatabaseClientSingleton.getAdmin(schemaDB); |
@@ -199,7 +200,8 @@ private void exportWithOptic(int productID) throws IOException { |
199 | 200 | // Create a Row manager to construct plans and query on |
200 | 201 | // rows projected from the documents |
201 | 202 | RowManager rowMgr = client.newRowManager(); |
202 | | - System.out.println("Writing the results to " + outputFile); |
| 203 | + File outputFile = File.createTempFile(outputFileName, ".txt"); |
| 204 | + System.out.println("Writing the results to " + outputFile.getAbsolutePath()); |
203 | 205 | try (FileWriter writer = new FileWriter(outputFile)) { |
204 | 206 | // Create a Function to pass to the OpticExportToWriterListener which |
205 | 207 | // would take each batch and do the necessary optic operations and return |
|
0 commit comments