diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/test/ScanTestDataPopulator.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/test/ScanTestDataPopulator.java index 14ac58766c..0cef5c4fba 100644 --- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/test/ScanTestDataPopulator.java +++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/test/ScanTestDataPopulator.java @@ -281,7 +281,7 @@ public class ScanTestDataPopulator { */ private void copyFile(File file) { - File outfile = new File(MANUAL_INGEST_DIR + "/" + file.getName()); + File outfile = new File(MANUAL_INGEST_DIR + "/scanTestDataPopulator/" + file.getName()); InputStream in = null; try { in = new FileInputStream(file); diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java index 99ae3dd8c2..c8b92072a5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java @@ -34,7 +34,6 @@ import ucar.unidata.io.RandomAccessFile; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.grib.GribRecord; -import com.raytheon.uf.common.dataplugin.grib.StatusConstants; import com.raytheon.uf.common.dataplugin.grib.exception.GribException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -109,7 +108,7 @@ public class GribDecoder { // manual ingest endpoint if (recordLengths.size() > 1) { raf.seek(0); - splitFile(file.getName(), raf, recordLengths); + splitFile(file.getName(), raf, recordLengths, edition); return new GribRecord[] {}; } } @@ -165,7 +164,7 @@ public class GribDecoder { * @throws IOException */ private void splitFile(String fileName, RandomAccessFile raf, - List sizes) throws IOException { + List sizes, int edition) throws IOException { FileOutputStream out = null; byte[] transfer = null; for (int i = 0; i < sizes.size(); i++) { @@ -175,7 +174,7 @@ public class GribDecoder { try { out = new FileOutputStream(System.getProperty("edex.home") - + "/data/manual/" + fileName + "_record_" + (i + 1)); + + "/data/manual/grib/grib" + edition + "LargeSplit/" + fileName + "_record_" + (i + 1)); out.write(transfer); out.close(); } finally { diff --git a/edexOsgi/com.raytheon.uf.edex.ohd/src/com/raytheon/uf/edex/ohd/pproc/ArealQpeGenSrv.java b/edexOsgi/com.raytheon.uf.edex.ohd/src/com/raytheon/uf/edex/ohd/pproc/ArealQpeGenSrv.java index 3df5d0b026..25130efb98 100644 --- a/edexOsgi/com.raytheon.uf.edex.ohd/src/com/raytheon/uf/edex/ohd/pproc/ArealQpeGenSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.ohd/src/com/raytheon/uf/edex/ohd/pproc/ArealQpeGenSrv.java @@ -229,7 +229,7 @@ public class ArealQpeGenSrv { } processSingleQpe(dd, hrap, subGrid); } - if (gribout.equalsIgnoreCase("ON") && qpe_out == true) { + if (gribout.equalsIgnoreCase("ON") && (qpe_out == true)) { gribTempFiles(); } @@ -342,7 +342,8 @@ public class ArealQpeGenSrv { cc.setTime(dt); SimpleDateFormat ffn = new SimpleDateFormat("ddHHmmss"); String dString = ffn.format(cc.getTime()); - File gribIngestFile = new File(d2d_input_dir + "/" + File gribIngestFile = new File(d2d_input_dir + File.separator + + "arealQpeGenSrv" + File.separator + fr.getName() + "_" + dString + ".grib"); log.info("Move and rename grib file " + goFile + " to " + mvFile); @@ -357,11 +358,13 @@ public class ArealQpeGenSrv { try { FileUtil.copyFile(mvFile, gribIngestFile); log.info("Copied grib file " + mvFile.getName() - + " to " + d2d_input_dir + + " to " + d2d_input_dir + File.separator + + "arealQpeGenSrv" + " for ingest to D2D. "); } catch (IOException e) { log.error("Copy grib file " + mvFile.getName() + " to " - + d2d_input_dir + " failed. "); + + d2d_input_dir + File.separator + + "arealQpeGenSrv" + " failed. "); e.printStackTrace(); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml index 22b6f12245..1ac0f8b47d 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml @@ -9,7 +9,7 @@ xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler" autoStartup="false"> + uri="file:${edex.home}/data/manual?delete=true&delay=5000&maxMessagesPerPoll=1000&exclusiveReadLockStrategy=#fileChangedStrategy&recursive=true" /> diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java index 550a82a8e2..cb05e7b8d8 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java @@ -132,14 +132,28 @@ public class MessageGenerator implements Processor { public File copyFileToArchive(File inFile) { String path = DIR + File.separator; - File dir = new File(path); - if (!dir.exists()) + + // Determine the sub-directory + String inputPath = inFile.getParent(); + + // Split on the manual directory to get the sub-directory + String[] parts = inputPath.split("manual"); + File dir = null; + if (parts.length > 1) { + dir = new File(path + parts[1]); + } else { + dir = new File(path); + } + + if (!dir.exists()) { dir.mkdirs(); + } File newFile = new File(dir, inFile.getName()); try { FileCopyUtils.copy(inFile, newFile); + statusHandler.handle(Priority.INFO, "DataManual: " + inFile.getAbsolutePath()); } catch (IOException e) { statusHandler.handle(Priority.ERROR, "Failed to copy file [" + inFile.getAbsolutePath() + "] to archive dir", e);