diff --git a/cave/com.raytheon.uf.viz.alertviz/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.alertviz/META-INF/MANIFEST.MF index ebb46adcc9..64d4991ccd 100644 --- a/cave/com.raytheon.uf.viz.alertviz/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.alertviz/META-INF/MANIFEST.MF @@ -17,7 +17,6 @@ Require-Bundle: org.eclipse.ui, com.raytheon.uf.common.alertviz, javax.jms;bundle-version="1.0.0", ch.qos.logback;bundle-version="1.0.13" -Bundle-ClassPath: . Export-Package: com.raytheon.uf.viz.alertviz, com.raytheon.uf.viz.alertviz.config Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/cave/com.raytheon.uf.viz.app.launcher/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.app.launcher/META-INF/MANIFEST.MF index 2c1fc8bd38..0c970a2538 100644 --- a/cave/com.raytheon.uf.viz.app.launcher/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.app.launcher/META-INF/MANIFEST.MF @@ -3,13 +3,13 @@ Bundle-ManifestVersion: 2 Bundle-Name: App Launcher Plug-in Bundle-SymbolicName: com.raytheon.uf.viz.app.launcher;singleton:=true Bundle-Version: 1.12.1174.qualifier -Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization +Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization Bundle-Activator: com.raytheon.uf.viz.app.launcher.Activator Bundle-Vendor: RAYTHEON Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, - com.raytheon.uf.common.localization;bundle-version="1.11.1", - com.raytheon.edex.common;bundle-version="1.11.1", + com.raytheon.uf.common.serialization, + com.raytheon.uf.common.localization;bundle-version="1.11.1", com.raytheon.uf.viz.core;bundle-version="1.11.5" Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.uf.viz.app.launcher, @@ -19,4 +19,5 @@ Export-Package: com.raytheon.uf.viz.app.launcher, com.raytheon.uf.viz.app.launcher.runner, com.raytheon.uf.viz.app.launcher.utilities Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Import-Package: com.raytheon.uf.common.ohd +Import-Package: com.raytheon.uf.common.ohd, + com.raytheon.uf.common.util diff --git a/cave/com.raytheon.uf.viz.app.launcher/src/com/raytheon/uf/viz/app/launcher/utilities/AppLauncherUtilities.java b/cave/com.raytheon.uf.viz.app.launcher/src/com/raytheon/uf/viz/app/launcher/utilities/AppLauncherUtilities.java index b04d9cfba5..66a3f76a6b 100644 --- a/cave/com.raytheon.uf.viz.app.launcher/src/com/raytheon/uf/viz/app/launcher/utilities/AppLauncherUtilities.java +++ b/cave/com.raytheon.uf.viz.app.launcher/src/com/raytheon/uf/viz/app/launcher/utilities/AppLauncherUtilities.java @@ -28,8 +28,8 @@ import java.util.Set; import javax.xml.bind.JAXB; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.viz.app.launcher.bundle.Entity; import com.raytheon.uf.viz.app.launcher.bundle.Launcher; import com.raytheon.uf.viz.app.launcher.exception.AppLauncherException; @@ -176,7 +176,7 @@ public final class AppLauncherUtilities { } catch (Exception e) { throw new AppLauncherException( "Unable to import App Launcher bundle " - + Util.printString(bundleLocation), e); + + StringUtil.printString(bundleLocation), e); } } } diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF index a67744bba3..595108a493 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF @@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.ui, org.geotools;bundle-version="2.5.8", com.raytheon.uf.common.geospatial;bundle-version="1.11.17", com.raytheon.viz.pointdata;bundle-version="1.11.17", - com.raytheon.edex.common;bundle-version="1.11.17", com.raytheon.uf.common.pointdata;bundle-version="1.11.17", com.raytheon.edex.meteolib;bundle-version="1.11.17", com.raytheon.viz.core;bundle-version="1.11.17", diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAGridTransformer.java b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAGridTransformer.java index 8b89eedb94..0fb5d2aabd 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAGridTransformer.java +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAGridTransformer.java @@ -33,13 +33,13 @@ import org.opengis.referencing.operation.MathTransform; import org.opengis.referencing.operation.TransformException; import com.raytheon.edex.meteoLib.Controller; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.pointdata.ParameterDescription; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataView; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.exception.VizException; @@ -172,7 +172,7 @@ public class OAGridTransformer { for (int i = 0; i < grid.length; i++) { if (grid[i] > 1e36f) { - grid[i] = Util.GRID_FILL_VALUE; + grid[i] = GridUtil.GRID_FILL_VALUE; } } return grid; diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResource.java b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResource.java index 3deb89e391..572e12a40b 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResource.java +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResource.java @@ -40,7 +40,6 @@ import org.eclipse.swt.graphics.RGB; import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.datum.PixelInCell; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; @@ -52,6 +51,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.alerts.AlertMessage; @@ -407,7 +407,7 @@ public class OAResource extends .getConverterTo(prefs.getDisplayUnits()); for (int i = 0; i < grid.length; i++) { - if (grid[i] != Util.GRID_FILL_VALUE) { + if (grid[i] != GridUtil.GRID_FILL_VALUE) { grid[i] = (float) converter.convert(grid[i]); } } @@ -498,7 +498,7 @@ public class OAResource extends GriddedImageDisplay image = (GriddedImageDisplay) renderable; double value = ((FloatBuffer) image.getData()).get(index); - if (value == Util.GRID_FILL_VALUE) { + if (value == GridUtil.GRID_FILL_VALUE) { return "NO DATA"; } @@ -527,22 +527,22 @@ public class OAResource extends double val22 = sliceData[y2 * transformer.getNx() + x2]; double val = 0.0; boolean data = false; - if (val11 != Util.GRID_FILL_VALUE) { + if (val11 != GridUtil.GRID_FILL_VALUE) { val += (x2 - x) * (y2 - y) * val11 / ((x2 - x1) * (y2 - y1)); data = true; } - if (val21 != Util.GRID_FILL_VALUE) { + if (val21 != GridUtil.GRID_FILL_VALUE) { val += (x - x1) * (y2 - y) * val21 / ((x2 - x1) * (y2 - y1)); data = true; } - if (val12 != Util.GRID_FILL_VALUE) { + if (val12 != GridUtil.GRID_FILL_VALUE) { val += (x2 - x) * (y - y1) * val12 / ((x2 - x1) * (y2 - y1)); data = true; } - if (val22 != Util.GRID_FILL_VALUE) { + if (val22 != GridUtil.GRID_FILL_VALUE) { val += (x - x1) * (y - y1) * val22 / ((x2 - x1) * (y2 - y1)); data = true; diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OATiltGridTransformer.java b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OATiltGridTransformer.java index e9daeccdbe..1546632056 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OATiltGridTransformer.java +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OATiltGridTransformer.java @@ -29,11 +29,11 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.operation.TransformException; import com.raytheon.edex.meteoLib.Controller; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataView; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.derivparam.library.DerivedParameterGenerator; @@ -129,7 +129,7 @@ public class OATiltGridTransformer extends OAGridTransformer { for (int i = 0; i < grid.length; i++) { if (grid[i] > 1e36f) { - grid[i] = Util.GRID_FILL_VALUE; + grid[i] = GridUtil.GRID_FILL_VALUE; } } return grid; @@ -193,8 +193,9 @@ public class OATiltGridTransformer extends OAGridTransformer { if (grid == null) { continue; } - FloatDataRecord fdr = new FloatDataRecord(parmDescription - .getParameterName(), "", grid, 2, new long[] { nx, ny }); + FloatDataRecord fdr = new FloatDataRecord( + parmDescription.getParameterName(), "", grid, 2, + new long[] { nx, ny }); cube.add(new CubeLevel((float) i, fdr)); } if (cube.size() < 3) { diff --git a/cave/com.raytheon.viz.ghg/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.ghg/META-INF/MANIFEST.MF index 329ff4aa2d..3a21e78902 100644 --- a/cave/com.raytheon.viz.ghg/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.ghg/META-INF/MANIFEST.MF @@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.ui, org.geotools, com.raytheon.viz.gfe, com.raytheon.viz.alerts, - com.raytheon.edex.common, org.jep, com.raytheon.uf.common.message;bundle-version="1.11.31", com.raytheon.uf.common.dataplugin.gfe, diff --git a/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java b/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java index 0098d464a2..b37ef2b233 100644 --- a/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java +++ b/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java @@ -44,7 +44,6 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; @@ -58,6 +57,7 @@ import com.raytheon.uf.common.site.SiteMap; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.viz.gfe.constants.StatusConstants; import com.raytheon.viz.gfe.core.DataManager; @@ -723,9 +723,9 @@ public final class GhgConfigData { */ public void addNamedFilter(String name, GhgDataFilter filter) throws VizException { - if (Util.isEmptyString(name) || (filter == null)) { + if (StringUtil.isEmptyString(name) || (filter == null)) { throw new VizException("Invalid filter save request - name = " - + Util.printString(name)); + + StringUtil.printString(name)); } filters.put(name, filter); } @@ -740,9 +740,9 @@ public final class GhgConfigData { * if the named filter does not exist */ public void deleteNamedFilter(String name) throws VizException { - if (Util.isEmptyString(name) || !filters.containsKey(name)) { + if (StringUtil.isEmptyString(name) || !filters.containsKey(name)) { throw new VizException("Invalid filter delete request, name " - + Util.printString(name) + " does not exist"); + + StringUtil.printString(name) + " does not exist"); } if (filters.get(name).name.equals(currentFilter.name)) { setDefaultAsCurrent(FeatureEnum.FILTERS); diff --git a/cave/com.raytheon.viz.hydro/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.hydro/META-INF/MANIFEST.MF index 9c17e8018a..9457730608 100644 --- a/cave/com.raytheon.viz.hydro/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.hydro/META-INF/MANIFEST.MF @@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.ui, com.raytheon.viz.ui, com.raytheon.viz.core, org.geotools, - com.raytheon.edex.common, com.raytheon.viz.hydrocommon, com.raytheon.viz.shapefile, com.raytheon.viz.core.graphing, diff --git a/edexOsgi/com.raytheon.edex.adaptersrv/src/com/raytheon/edex/adapterSrv/AdapterSrv.java b/edexOsgi/com.raytheon.edex.adaptersrv/src/com/raytheon/edex/adapterSrv/AdapterSrv.java index 725c5700d2..501e54bdd0 100644 --- a/edexOsgi/com.raytheon.edex.adaptersrv/src/com/raytheon/edex/adapterSrv/AdapterSrv.java +++ b/edexOsgi/com.raytheon.edex.adaptersrv/src/com/raytheon/edex/adapterSrv/AdapterSrv.java @@ -24,9 +24,9 @@ import java.util.ArrayList; import com.raytheon.edex.msg.Command; import com.raytheon.edex.msg.ProgramOutput; -import com.raytheon.edex.util.Util; import com.raytheon.edex.utility.StreamHandler; import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; /** @@ -101,7 +101,7 @@ public class AdapterSrv { } catch (Exception e) { throw new EdexException( "AdapterSrv: Error running external executable: " - + Util.printString(command), e); + + StringUtil.printString(command), e); } finally { // #DR 10955 if (proc != null) { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java index c2e6cd344e..d2a2e04b70 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java +++ b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java @@ -38,7 +38,6 @@ import com.raytheon.edex.subscription.runners.SubscribeRunner; import com.raytheon.edex.subscription.util.Tools; import com.raytheon.edex.uengine.runners.IMicroEngine; import com.raytheon.edex.uengine.runners.MicroEngine; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage; import com.raytheon.uf.common.message.Header; @@ -46,6 +45,7 @@ import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.util.ReflectionUtil; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; /** @@ -261,15 +261,15 @@ public class ScriptRunner { } else { String path = record.getFilepath(); String args = record.getArguments(); - if (Util.isEmptyString(path) && Util.isEmptyString(args)) { + if (StringUtil.isEmptyString(path) && StringUtil.isEmptyString(args)) { logger.warn("Unable to execute script for " + record.toString()); return; } - if (!Util.isEmptyString(args)) { + if (!StringUtil.isEmptyString(args)) { args = args.replaceAll(TRIGGER_KEY, trigger); } - script = (Util.isEmptyString(path) ? "" : path) + " " - + (Util.isEmptyString(args) ? "" : args); + script = (StringUtil.isEmptyString(path) ? "" : path) + " " + + (StringUtil.isEmptyString(args) ? "" : args); } IMicroEngine engine = null; try { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java index 5ba4a0a22c..32b8feb3e2 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java +++ b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java @@ -25,8 +25,8 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.message.Message; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; /** @@ -121,7 +121,7 @@ public class SubscribeRunner { */ public static ISubscribeRunner getInstance(String oper, Message message) throws EdexException { ISubscribeRunner retVal = null; - if (Util.isEmptyString(oper)) { + if (StringUtil.isEmptyString(oper)) { throw new EdexException("Unable to initialize ISubscribeRunner instance; null or empty operation specified - unable to continue"); } SubscribeAction action = SubscribeAction.translate(oper); diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageASCII.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageASCII.java index fc218342ed..0296c2412c 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageASCII.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageASCII.java @@ -23,9 +23,9 @@ package com.raytheon.edex.msg; import java.util.Calendar; import java.util.Date; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.message.response.AbstractResponseMessage; import com.raytheon.uf.common.util.ConvertUtil; +import com.raytheon.uf.common.util.StringUtil; /** * Represents an ASCII product response from EDEX. @@ -75,13 +75,13 @@ public class ResponseMessageASCII extends AbstractResponseMessage { String time, String uri) { this.fileType = "ascii"; - this.filename = Util.isEmptyString(filename)?"":filename; + this.filename = StringUtil.isEmptyString(filename)?"":filename; this.contents = contents; - this.type = Util.isEmptyString(type)?"":type; - this.station = Util.isEmptyString(station)?"":station; - this.time = Util.isEmptyString(time)?"":time; + this.type = StringUtil.isEmptyString(type)?"":type; + this.station = StringUtil.isEmptyString(station)?"":station; + this.time = StringUtil.isEmptyString(time)?"":time; - this.dataURI = Util.isEmptyString(uri)?"":uri; + this.dataURI = StringUtil.isEmptyString(uri)?"":uri; try { Calendar valid = (Calendar)ConvertUtil.convertObject(time, Calendar.class); this.validTime = valid.getTime(); diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageNull.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageNull.java index aa81eeca9e..6dbd165cb7 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageNull.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageNull.java @@ -19,8 +19,8 @@ **/ package com.raytheon.edex.msg; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.message.response.AbstractResponseMessage; +import com.raytheon.uf.common.util.StringUtil; /** * A response message that allows the μEngine to respond when @@ -57,9 +57,9 @@ public class ResponseMessageNull extends AbstractResponseMessage { */ private ResponseMessageNull(String message, String uri, String time) { this.fileType="ascii"; - this.dataURI = Util.isEmptyString(uri)?"":uri; - this.time = Util.isEmptyString(time)?"":time; - this.message = Util.isEmptyString(message)?"":message; + this.dataURI = StringUtil.isEmptyString(uri)?"":uri; + this.time = StringUtil.isEmptyString(time)?"":time; + this.message = StringUtil.isEmptyString(message)?"":message; } /** * Static method that creates an null Response Message. Uses the diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageSubscription.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageSubscription.java index 7f117bb804..71026e26dc 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageSubscription.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/msg/ResponseMessageSubscription.java @@ -22,8 +22,8 @@ package com.raytheon.edex.msg; import java.util.Date; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.message.response.AbstractResponseMessage; +import com.raytheon.uf.common.util.StringUtil; /** * Represent a subscription response for the server. This message @@ -64,9 +64,9 @@ public class ResponseMessageSubscription extends AbstractResponseMessage { Exception cause) { this.statusMessage = message; if (cause != null) { - this.statusMessage += " Cause was " + Util.printString(cause); + this.statusMessage += " Cause was " + StringUtil.printString(cause); if(cause.getCause() != null) { - this.statusMessage += " " + Util.printString(cause.getCause()); + this.statusMessage += " " + StringUtil.printString(cause.getCause()); } } diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/Subscription.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/Subscription.java index 85d168dbbf..f50b949535 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/Subscription.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/Subscription.java @@ -24,8 +24,8 @@ import java.util.Calendar; import java.util.HashSet; import java.util.Set; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; +import com.raytheon.uf.common.util.StringUtil; /** * Contains the information that describes a single product subscription. @@ -243,7 +243,7 @@ public class Subscription extends PersistableDataObject { */ public String toString() { return this.getClass().getName() + "[count=" + this.count + - ", URI=" + Util.printString((String)identifier); + ", URI=" + StringUtil.printString((String)identifier); } public int getId() { diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/SubscriptionManager.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/SubscriptionManager.java index e76cf53ff9..268bb5a8d6 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/SubscriptionManager.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/subscription/SubscriptionManager.java @@ -35,6 +35,7 @@ import com.raytheon.edex.db.dao.SubscribeDAO; import com.raytheon.edex.exception.SubscriptionException; import com.raytheon.edex.util.Util; import com.raytheon.edex.util.XMLUtils; +import com.raytheon.uf.common.util.StringUtil; /** * This class manages the product subscription list. It is designed as a POJO @@ -162,8 +163,8 @@ public final class SubscriptionManager implements ISubscriptionManager { } } catch (Exception e) { String msg = "Unable fulfill subscription request, dataURI=" - + Util.printString(dataURI) + ", scriptID=" - + Util.printString(scriptID); + + StringUtil.printString(dataURI) + ", scriptID=" + + StringUtil.printString(scriptID); e.printStackTrace(); throw new SubscriptionException(msg, e); } @@ -222,7 +223,7 @@ public final class SubscriptionManager implements ISubscriptionManager { */ public synchronized boolean isSubscribed(String dataURI) { logger.debug("isSubscribed() received subscription inquery, URI is " - + Util.printString(dataURI)); + + StringUtil.printString(dataURI)); /* check to see if the uri exactly matches a subscription */ if (subscriptions.containsKey(dataURI)) { return true; @@ -299,12 +300,12 @@ public final class SubscriptionManager implements ISubscriptionManager { // Object obj = dataLayer.getSubscription(dataURI); if (obj == null && obj instanceof Subscription) { logger.error("No Subscription object available for " - + Util.printString(dataURI)); + + StringUtil.printString(dataURI)); } } catch (Exception e) { logger.error("Unable to get subscription information for " - + Util.printString(dataURI), e); + + StringUtil.printString(dataURI), e); } return subscription; } @@ -344,15 +345,15 @@ public final class SubscriptionManager implements ISubscriptionManager { } else { // no matching script String msg = "no matching script, dataURI=" - + Util.printString(dataURI) + ", scriptID= " - + Util.printString(scriptID); + + StringUtil.printString(dataURI) + ", scriptID= " + + StringUtil.printString(scriptID); logger.warn("unsubscribe() " + msg); throw new SubscriptionException(msg); } } else { // no subscription for the data String msg = "No subscription exists, dataURI=" - + Util.printString(dataURI); + + StringUtil.printString(dataURI); logger.warn("unsubscribe() " + msg); throw new SubscriptionException(msg); } @@ -360,8 +361,8 @@ public final class SubscriptionManager implements ISubscriptionManager { // error performing the unsubscribe if (!(e instanceof SubscriptionException)) { String msg = "Unable to unsubscribe. dataURI=" - + Util.printString(dataURI) + ", scriptID=" - + Util.printString(scriptID); + + StringUtil.printString(dataURI) + ", scriptID=" + + StringUtil.printString(scriptID); throw new SubscriptionException(msg, e); } else { throw (SubscriptionException) e; diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java index 1c8158e133..339cbd2cf5 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java @@ -43,7 +43,6 @@ import org.springframework.context.ConfigurableApplicationContext; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.FileUtil; -import com.raytheon.uf.common.util.GridUtil; /** * Contains utility methods for use in common. @@ -61,7 +60,7 @@ import com.raytheon.uf.common.util.GridUtil; * Nov 09, 2012 1322 djohnson Add close for Spring context. * Feb 15, 2013 1638 mschenke Deleted unused functions and moved ones used by common/viz * code into common projects - * + * * * * @author mfegan @@ -91,37 +90,10 @@ public final class Util { */ public static final String EOL = FileUtil.EOL; - public static final float GRID_FILL_VALUE = GridUtil.GRID_FILL_VALUE; - private Util() { // No Instantiation } - /** - * Simple check if str is null or empty. - * - * @param str - * A string to check - * @return true if string is null or empty, false otherwise - */ - public static final boolean isEmptyString(String str) { - return (str == null) || ("".equals(str)); - } - - /** - * Wraps input Object.toString (if non-null) in [] for display (helps show - * empty string in output).
- * Example: printString("test") would display "[test]"
- * printString(null) would display "[null]" - * - * @param obj - * An object instance - * @return The object's {@link Object#toString()} value - */ - public static final String printString(Object obj) { - return "[" + (obj == null ? "null" : obj.toString()) + "]"; - } - /** * Get the filename from a fully qualified path * @@ -439,30 +411,6 @@ public final class Util { return status; } - /** - * Determines if the given string is all alpha-numeric characters - * - * @param str - * The string to test - * @return True if the string is alpha-numeric - */ - public static boolean isAlnum(String str) { - int count = 0; - Pattern pat = Pattern.compile("\\p{Alnum}"); - Matcher mat = pat.matcher(str); - - while (mat.find()) { - count++; - } - - if (count == str.length()) { - return true; - } else { - return false; - } - - } - /** * Retrieve date as a long in the index standard format: yyyy-MM-dd * kk:mm:ss.SSS diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/XMLUtils.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/XMLUtils.java index 26fc387c86..820f15888f 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/XMLUtils.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/XMLUtils.java @@ -45,6 +45,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; +import com.raytheon.uf.common.util.StringUtil; import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl; /** @@ -552,13 +553,13 @@ public final class XMLUtils { throws Exception { NodeList nodes = document.getElementsByTagName(tagName); if(nodes == null) { - throw new Exception("Unable to find tag " + Util.printString(tagName)); + throw new Exception("Unable to find tag " + StringUtil.printString(tagName)); } Node node = nodes.item(0); Node attribute = node.getAttributes().getNamedItem(name); if (attribute == null) { - throw new Exception("Unable to find attribute " + Util.printString(name) + - " for tag " + Util.printString(tagName)); + throw new Exception("Unable to find attribute " + StringUtil.printString(name) + + " for tag " + StringUtil.printString(tagName)); } String retVal = attribute.getNodeValue(); return retVal; diff --git a/edexOsgi/com.raytheon.edex.monitorsrv/src/com/raytheon/edex/monitors/EdexLatencyMonitor.java b/edexOsgi/com.raytheon.edex.monitorsrv/src/com/raytheon/edex/monitors/EdexLatencyMonitor.java index f5a0a29b67..e676ee0681 100644 --- a/edexOsgi/com.raytheon.edex.monitorsrv/src/com/raytheon/edex/monitors/EdexLatencyMonitor.java +++ b/edexOsgi/com.raytheon.edex.monitorsrv/src/com/raytheon/edex/monitors/EdexLatencyMonitor.java @@ -30,7 +30,7 @@ import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; import com.raytheon.edex.services.MonitorSrv; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * Uses JMX to obtain latency information for an end-point. Reports queue size, @@ -176,7 +176,7 @@ public class EdexLatencyMonitor extends AEdexMonitor { Integer queueSize = (Integer)connection.getAttribute(theObject, "QueueSize"); Long queuedEvents = (Long)connection.getAttribute(theObject, "QueuedEvents"); Long averageTime = (Long)connection.getAttribute(theObject, "AverageExecutionTime"); - logger.info(String.format(REPORT_FORMAT,Util.printString(beanName), + logger.info(String.format(REPORT_FORMAT,StringUtil.printString(beanName), queueSize,queuedEvents,averageTime)); } catch (Exception e) { e.printStackTrace(); diff --git a/edexOsgi/com.raytheon.edex.notifysrv/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.notifysrv/META-INF/MANIFEST.MF index 70a3c2a380..3addbb7de8 100644 --- a/edexOsgi/com.raytheon.edex.notifysrv/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.notifysrv/META-INF/MANIFEST.MF @@ -10,5 +10,5 @@ Require-Bundle: com.raytheon.uf.edex.core;bundle-version="1.12.1174", com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174", org.apache.commons.configuration;bundle-version="1.6.0" Import-Package: com.raytheon.edex.subscription, - com.raytheon.edex.util, + com.raytheon.uf.common.util, org.apache.commons.logging diff --git a/edexOsgi/com.raytheon.edex.notifysrv/src/com/raytheon/edex/services/NotifySrv.java b/edexOsgi/com.raytheon.edex.notifysrv/src/com/raytheon/edex/services/NotifySrv.java index d11edd0b81..3562398fe2 100644 --- a/edexOsgi/com.raytheon.edex.notifysrv/src/com/raytheon/edex/services/NotifySrv.java +++ b/edexOsgi/com.raytheon.edex.notifysrv/src/com/raytheon/edex/services/NotifySrv.java @@ -31,8 +31,8 @@ import com.raytheon.edex.subscription.ISubscriptionManager; import com.raytheon.edex.subscription.Script; import com.raytheon.edex.subscription.Subscription; import com.raytheon.edex.subscription.SubscriptionManager; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataplugin.PluginDataObject; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.props.PropertiesFactory; @@ -104,7 +104,7 @@ public class NotifySrv { .getSubscriptionKey(dataURI); // messages = new ArrayList(); logger.info("-subscription exists for " - + Util.printString(dataURI)); + + StringUtil.printString(dataURI)); Configuration properties = PropertiesFactory.getInstance() .getConfiguration( ISubscriptionManager.CONFIGURATION_NAME); diff --git a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java index c591a82496..5ba540904a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java +++ b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java @@ -32,7 +32,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * @@ -113,7 +113,7 @@ public class CcfpSeparator extends AbstractRecordSeparator { public String next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return ""; } else { return temp; diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java index f7ea833ca0..7cace175e3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java @@ -49,6 +49,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.util.FileUtil; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.common.util.file.FilenameFilters; import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.database.cluster.ClusterLockUtils; @@ -111,8 +112,8 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor { FilenameFilters.ACCEPT_FILES, FilenameFilters.byFileExtension(".xml")); - List thinnedModelFiles = FileUtil.listFiles(commonPath, - filter, false); + List thinnedModelFiles = FileUtil.listFiles(commonPath, filter, + false); for (File file : thinnedModelFiles) { try { @@ -247,7 +248,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor { throws GribException { GridCoverage coverage = assembledRecord.getLocation(); float[] data = new float[coverage.getNx() * coverage.getNy()]; - Arrays.fill(data, Util.GRID_FILL_VALUE); + Arrays.fill(data, GridUtil.GRID_FILL_VALUE); assembledRecord.setMessageData(data); mergeData(record, assembledRecord, thinned); try { diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/uengine/tasks/grib/GribMap.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/uengine/tasks/grib/GribMap.java index fd36718526..a6e5f75105 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/uengine/tasks/grib/GribMap.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/uengine/tasks/grib/GribMap.java @@ -40,8 +40,8 @@ import org.geotools.coverage.grid.GridGeometry2D; import com.raytheon.edex.colormap.ColorMapManager; import com.raytheon.edex.uengine.tasks.ScriptTask; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.datastorage.records.IDataRecord; +import com.raytheon.uf.common.util.GridUtil; /** * GribMap task derived from original uEngine GribMap task. Maps grid data to an @@ -163,7 +163,7 @@ public class GribMap extends ScriptTask { int pixels = gribData.length; for (int i = 0; i < pixels; i++) { - if (gribData[i] != Util.GRID_FILL_VALUE) { + if (gribData[i] != GridUtil.GRID_FILL_VALUE) { if (max < gribData[i]) { max = gribData[i]; } diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestSeparator.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestSeparator.java index c4d59b450b..51118a57a6 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestSeparator.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestSeparator.java @@ -36,7 +36,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * @@ -111,7 +111,7 @@ public class MesowestSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java index b8c3535aa0..8e95cb6b37 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarSeparator.java @@ -38,7 +38,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.wmo.message.WMOHeader; /** @@ -149,7 +149,7 @@ public class MetarSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return new byte[0]; } else { return temp.getBytes(); diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/output/FileOut.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/output/FileOut.java index ea755457a9..ebb4593728 100644 --- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/output/FileOut.java +++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/output/FileOut.java @@ -27,8 +27,8 @@ import java.util.UUID; import com.raytheon.edex.uengine.exception.MicroEngineException; import com.raytheon.edex.uengine.tasks.ScriptTask; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.FileUtil; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.props.EnvProperties; import com.raytheon.uf.edex.core.props.PropertiesFactory; @@ -88,7 +88,7 @@ public class FileOut extends ScriptTask { /* * make sure there is an output directory defined */ - if (Util.isEmptyString(destDir)) { + if (StringUtil.isEmptyString(destDir)) { // default to uengineOutDir destDir = uengineOutDir; logger.debug("Defaulting destDir to: " + destDir); @@ -114,7 +114,7 @@ public class FileOut extends ScriptTask { // get the URI for the image out String suffix = "." + format; - if (uri != null && !Util.isEmptyString(uri.toString())) { + if (uri != null && !StringUtil.isEmptyString(uri.toString())) { destFile = new File(uri).getName(); if (!destFile.endsWith(suffix)) { destFile += suffix; diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java index 52658326b3..1b75fc00e0 100644 --- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java +++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java @@ -35,7 +35,7 @@ import com.raytheon.edex.msg.ResponseMessageInline; import com.raytheon.edex.uengine.ResponseUtil; import com.raytheon.edex.uengine.exception.MicroEngineException; import com.raytheon.edex.uengine.tasks.ScriptTask; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * Makes an inline response message. Derived from old uEngine @@ -85,7 +85,7 @@ public class MakeResponseInline extends ScriptTask { imageData.add(dataItem); } else { throw new MicroEngineException("unknown data type " - + Util.printString(dataItem.getClass().getName()) + + StringUtil.printString(dataItem.getClass().getName()) + " unable to continue."); } // create the return object - need to call the create method. diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/JmsSupport.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/JmsSupport.java index 8390466da0..30778e0cc7 100644 --- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/JmsSupport.java +++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/JmsSupport.java @@ -33,7 +33,7 @@ import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.util.IndentPrinter; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * Taken from test.ToolSupport, should probably be cleaned up and moved to common? @@ -120,7 +120,7 @@ public class JmsSupport { } public MessageConsumer createConsumer(Session session, MessageListener msgListener, String selector) throws JMSException { MessageConsumer consumer; - if(Util.isEmptyString(selector)) { + if(StringUtil.isEmptyString(selector)) { consumer = session.createConsumer(destination); } else { consumer = session.createConsumer(destination, selector); diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/MEUtils.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/MEUtils.java index 4b1c827f0d..30863b84bd 100644 --- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/MEUtils.java +++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/util/MEUtils.java @@ -32,7 +32,7 @@ import javax.jms.TextMessage; import org.apache.activemq.command.ActiveMQQueue; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * Contains utility methods that are specific to the Micro Engine. All @@ -160,7 +160,7 @@ public class MEUtils { /* sending the message */ /* set the message correlation id */ - if (Util.isEmptyString(correlationID)) { + if (StringUtil.isEmptyString(correlationID)) { correlationID = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", Calendar.getInstance()); } diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/web/RunAction.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/web/RunAction.java index 31fede40b7..489e759d9e 100644 --- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/web/RunAction.java +++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/web/RunAction.java @@ -51,6 +51,7 @@ import com.raytheon.edex.util.Util; import com.raytheon.edex.util.XMLUtils; import com.raytheon.uf.common.message.response.ResponseMessageError; import com.raytheon.uf.common.util.FileUtil; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; /** @@ -93,7 +94,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String receiveTime = request.getParameter("receiveTime"); long receive = 5000; boolean jsEngine = false; - theLogger.info("request type is " + Util.printString(requestType)); + theLogger.info("request type is " + StringUtil.printString(requestType)); if (requestType != null) { if (requestType.equals("ascii")) { actionXML = createActionASCII(request); @@ -237,7 +238,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements Calendar cal = Calendar.getInstance(); String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal); String name = request.getParameter("scriptname"); - if (Util.isEmptyString(name)) { + if (StringUtil.isEmptyString(name)) { name = ""; } String function = request.getParameter("function"); @@ -249,7 +250,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String imageFormat = request.getParameter("imageformat"); String reproject = request.getParameter("reproject"); String count = request.getParameter("count"); - if (Util.isEmptyString(count)) { + if (StringUtil.isEmptyString(count)) { count = "1"; } boolean subscription = function.equalsIgnoreCase("subscribe"); @@ -267,15 +268,15 @@ public class RunAction extends javax.servlet.http.HttpServlet implements action.append("var dataRequest = new RadarRequest();" + eol); action.append("dataRequest.requestImage(true);" + eol); action.append("dataRequest.setCount(" + count + ");" + eol); - if (!Util.isEmptyString(productCode)) { + if (!StringUtil.isEmptyString(productCode)) { action.append("dataRequest.addList(\"productCode\",\"" + productCode + "\");"); } - if (!Util.isEmptyString(location)) { + if (!StringUtil.isEmptyString(location)) { action.append("dataRequest.addParameter(\"icao\",\"" + location + "\");"); } - if (!Util.isEmptyString(elevation)) { + if (!StringUtil.isEmptyString(elevation)) { action.append("dataRequest.addParameter(\"primaryElevationAngle\",\"" + elevation + "\");"); } @@ -311,7 +312,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal); StringBuffer action = new StringBuffer(); String name = request.getParameter("scriptname"); - if (Util.isEmptyString(name)) { + if (StringUtil.isEmptyString(name)) { name = ""; } String function = request.getParameter("function"); @@ -324,7 +325,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String reproject = request.getParameter("reproject"); String count = request.getParameter("count"); - if (Util.isEmptyString(count)) { + if (StringUtil.isEmptyString(count)) { count = "1"; } boolean subscription = function.equalsIgnoreCase("subscribe"); @@ -381,7 +382,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal); StringBuffer action = new StringBuffer(); String name = request.getParameter("scriptname"); - if (Util.isEmptyString(name)) { + if (StringUtil.isEmptyString(name)) { name = "GRIB Request"; } @@ -399,22 +400,22 @@ public class RunAction extends javax.servlet.http.HttpServlet implements /* create the value for the levelinfo query. */ StringBuffer levelInfo = new StringBuffer(); - if (!Util.isEmptyString(level2)) { + if (!StringUtil.isEmptyString(level2)) { levelInfo.append(level2); } - if (!Util.isEmptyString(level1)) { - if (!Util.isEmptyString(level2)) { + if (!StringUtil.isEmptyString(level1)) { + if (!StringUtil.isEmptyString(level2)) { levelInfo.append("-"); } levelInfo.append(level1); } - if (!Util.isEmptyString(units)) { + if (!StringUtil.isEmptyString(units)) { if (levelInfo.length() != 0) { levelInfo.append("_").append(units); } } - if (Util.isEmptyString(count)) { + if (StringUtil.isEmptyString(count)) { count = "1"; } // boolean subscription = function.equalsIgnoreCase("subscribe"); @@ -433,11 +434,11 @@ public class RunAction extends javax.servlet.http.HttpServlet implements action.append("dataRequest.setCount(" + count + ");"); action.append("dataRequest.addParameter(\"paramid\",\"" + parameter + "\");" + eol); - if (!Util.isEmptyString(levelInfo.toString())) { + if (!StringUtil.isEmptyString(levelInfo.toString())) { action.append("dataRequest.addParameter(\"levelinfo\",\"" + levelInfo.toString() + "\");" + eol); } - if (!Util.isEmptyString(forecast)) { + if (!StringUtil.isEmptyString(forecast)) { action.append("dataRequest.addParameter(\"forecasttime\",\"" + forecast + "\");" + eol); } @@ -516,7 +517,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String timeType = request.getParameter("refTime"); String count = request.getParameter("count"); - if (Util.isEmptyString(count)) { + if (StringUtil.isEmptyString(count)) { count = "1"; } boolean subscription = function.equalsIgnoreCase("subscribe"); @@ -576,7 +577,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String station = request.getParameter("station"); String count = request.getParameter("count"); - if (Util.isEmptyString(count)) { + if (StringUtil.isEmptyString(count)) { count = "1"; } boolean subscription = function.equalsIgnoreCase("subscribe"); @@ -977,7 +978,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements out.println("

No Data Available


"); try { String subresp = getSubscriptionMsg(responseStr); - if (!Util.isEmptyString(subresp)) { + if (!StringUtil.isEmptyString(subresp)) { out.println("\n"); out.println("\n"); out.println(subresp); @@ -1033,7 +1034,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements htmlStr.append("
Subscription results:
\n"); try { String subresp = getSubscriptionMsg(responseStr); - if (!Util.isEmptyString(subresp)) { + if (!StringUtil.isEmptyString(subresp)) { htmlStr.append("\n"); htmlStr.append("\n"); htmlStr.append(subresp); @@ -1520,7 +1521,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements (type.equalsIgnoreCase("taf") ? "taf" : "obs")); dataUri.append("/.+?"); dataUri.append("/").append(type); - if (Util.isEmptyString(station)) { + if (StringUtil.isEmptyString(station)) { dataUri.append("/.+?"); } else { dataUri.append("/").append(station); @@ -1544,20 +1545,20 @@ public class RunAction extends javax.servlet.http.HttpServlet implements String level2 = request.getParameter("level2"); String units = request.getParameter("unit"); String forecast = request.getParameter("forecast"); - if (Util.isEmptyString(forecast)) { + if (StringUtil.isEmptyString(forecast)) { forecast = ".+"; } StringBuffer levelInfo = new StringBuffer(); - if (!Util.isEmptyString(level2)) { + if (!StringUtil.isEmptyString(level2)) { levelInfo.append(level2); } - if (!Util.isEmptyString(level1)) { - if (!Util.isEmptyString(level2)) { + if (!StringUtil.isEmptyString(level1)) { + if (!StringUtil.isEmptyString(level2)) { levelInfo.append("-"); } levelInfo.append(level1); } - if (!Util.isEmptyString(units)) { + if (!StringUtil.isEmptyString(units)) { if (levelInfo.length() != 0) { levelInfo.append("_").append(units); } @@ -1585,15 +1586,15 @@ public class RunAction extends javax.servlet.http.HttpServlet implements private String makeRadarDataURI(HttpServletRequest request) throws Exception { String location = request.getParameter("station"); - if (Util.isEmptyString(location)) { + if (StringUtil.isEmptyString(location)) { location = ".+?"; } String productCode = request.getParameter("productcode"); - if (Util.isEmptyString(productCode)) { + if (StringUtil.isEmptyString(productCode)) { productCode = ".+?"; } String elevation = request.getParameter("elevation"); - if (Util.isEmptyString(elevation)) { + if (StringUtil.isEmptyString(elevation)) { elevation = ".+?"; } StringBuffer dataUri = new StringBuffer(); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.java index a8d7df9fba..7c60133a23 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.java @@ -41,11 +41,11 @@ import org.hibernate.annotations.Immutable; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.gfe.serialize.ParmIDAdapter; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter; +import com.raytheon.uf.common.util.StringUtil; /** * @@ -315,11 +315,11 @@ public class ParmID implements Comparable { return false; } - if (!Util.isAlnum(parmName)) { + if (!StringUtil.isAlnum(parmName)) { return false; } - if (!Util.isAlnum(parmLevel)) { + if (!StringUtil.isAlnum(parmLevel)) { return false; } diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java index 95f2218783..c2c6d7ca4c 100644 --- a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java +++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java @@ -23,6 +23,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; @@ -272,4 +274,53 @@ public final class StringUtil { return sb.toString(); } + + /** + * Wraps input Object.toString (if non-null) in [] for display (helps show + * empty string in output).
+ * Example: printString("test") would display "[test]"
+ * printString(null) would display "[null]" + * + * @param obj + * An object instance + * @return The object's {@link Object#toString()} value + */ + public static final String printString(Object obj) { + return "[" + (obj == null ? "null" : obj.toString()) + "]"; + } + + /** + * Simple check if str is null or empty. + * + * @param str + * A string to check + * @return true if string is null or empty, false otherwise + */ + public static final boolean isEmptyString(String str) { + return (str == null) || ("".equals(str)); + } + + /** + * Determines if the given string is all alpha-numeric characters + * + * @param str + * The string to test + * @return True if the string is alpha-numeric + */ + public static boolean isAlnum(String str) { + int count = 0; + Pattern pat = Pattern.compile("\\p{Alnum}"); + Matcher mat = pat.matcher(str); + + while (mat.find()) { + count++; + } + + if (count == str.length()) { + return true; + } else { + return false; + } + + } } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/GridMetadataAdapter.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/GridMetadataAdapter.java index 76a97baa99..681c75e104 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/GridMetadataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/GridMetadataAdapter.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import com.google.common.annotations.VisibleForTesting; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.datadelivery.registry.GriddedCoverage; import com.raytheon.uf.common.datadelivery.registry.Parameter; import com.raytheon.uf.common.datadelivery.retrieval.xml.RetrievalAttribute; @@ -32,6 +31,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.gridcoverage.GridCoverage; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.edex.datadelivery.retrieval.util.ResponseProcessingUtilities; /** @@ -171,7 +171,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter { for (int x = 0; x < nx; x++) { float value = origVals[(nx * y) + x]; if (value == missingValue) { - value = Util.GRID_FILL_VALUE; + value = GridUtil.GRID_FILL_VALUE; } returnVals[(nx * revy) + x] = value; } @@ -196,7 +196,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter { float[] vals = new float[(nx * ny)]; for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { - vals[(nx * y) + x] = Util.GRID_FILL_VALUE; + vals[(nx * y) + x] = GridUtil.GRID_FILL_VALUE; } } // writes in the values of the sub cut array actually received from @@ -228,7 +228,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter { // fill it up for (int y = 0; y < ny; y++) { for (int x = 0; x < nx; x++) { - vals[(nx * y) + x] = Util.GRID_FILL_VALUE; + vals[(nx * y) + x] = GridUtil.GRID_FILL_VALUE; } } // writes in the values of the sub cut array @@ -238,7 +238,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter { vals[bin] = subValues[bin]; if (x == (dnx - 1)) { for (int i = 0; i < offset; i++) { - vals[bin + i] = Util.GRID_FILL_VALUE; + vals[bin + i] = GridUtil.GRID_FILL_VALUE; } } } @@ -246,7 +246,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter { return vals; } - + @Override public PluginDataObject getRecord(Integer index) { if (pdos != null && index < pdos.length) { diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/opendap/OpenDAPMetaDataParser.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/opendap/OpenDAPMetaDataParser.java index 03457fd269..4b852bc1fe 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/opendap/OpenDAPMetaDataParser.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/opendap/OpenDAPMetaDataParser.java @@ -29,7 +29,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.datadelivery.registry.Collection; import com.raytheon.uf.common.datadelivery.registry.DataLevelType; import com.raytheon.uf.common.datadelivery.registry.DataLevelType.LevelType; @@ -58,6 +57,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.util.ImmutableDate; import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.edex.datadelivery.retrieval.Link; import com.raytheon.uf.edex.datadelivery.retrieval.LinkStore; import com.raytheon.uf.edex.datadelivery.retrieval.MetaDataParser; @@ -138,7 +138,9 @@ class OpenDAPMetaDataParser extends MetaDataParser { if (levelType.equals(LevelType.MB) || levelType.equals(LevelType.SEAB)) { - List levelList = OpenDAPParseUtility.getInstance().parseLevels(gdsmd.getUrl(), serviceConfig.getConstantValue("LEV")); + List levelList = OpenDAPParseUtility.getInstance() + .parseLevels(gdsmd.getUrl(), + serviceConfig.getConstantValue("LEV")); LookupManager.getInstance().modifyLevelLookups( collectionName, dz, levMin, levMax, levelList); } @@ -185,9 +187,8 @@ class OpenDAPMetaDataParser extends MetaDataParser { * @return */ private Map getParameters(DAS das, - GriddedDataSet dataSet, - GriddedDataSetMetaData gdsmd, Link link, Collection collection, - String dataDateFormat) { + GriddedDataSet dataSet, GriddedDataSetMetaData gdsmd, Link link, + Collection collection, String dataDateFormat) { final String collectionName = dataSet.getCollectionName(); final String url = gdsmd.getUrl(); @@ -229,7 +230,7 @@ class OpenDAPMetaDataParser extends MetaDataParser { final String missing_value = serviceConfig .getConstantValue("MISSING_VALUE"); final String fill_value = serviceConfig.getConstantValue("FILL_VALUE"); - final String fill = new Float(Util.GRID_FILL_VALUE).toString(); + final String fill = new Float(GridUtil.GRID_FILL_VALUE).toString(); // process globals first // process time @@ -238,19 +239,20 @@ class OpenDAPMetaDataParser extends MetaDataParser { AttributeTable at = das.getAttributeTable(timecon); Time time = new Time(); // number of times - time.setNumTimes(new Integer(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(size).getValueAt(0))).intValue()); + time.setNumTimes(new Integer(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(size).getValueAt(0))).intValue()); // minimum time val - time.setStart(OpenDAPParseUtility.getInstance().parseDate(at.getAttribute( - minimum).getValueAt(0))); + time.setStart(OpenDAPParseUtility.getInstance().parseDate( + at.getAttribute(minimum).getValueAt(0))); // maximum time val - time.setEnd(OpenDAPParseUtility.getInstance().parseDate(at.getAttribute(maximum) - .getValueAt(0))); + time.setEnd(OpenDAPParseUtility.getInstance().parseDate( + at.getAttribute(maximum).getValueAt(0))); // format of time time.setFormat(dataDateFormat); // step - List step = OpenDAPParseUtility.getInstance().parseTimeStep(at - .getAttribute(time_step).getValueAt(0)); + List step = OpenDAPParseUtility + .getInstance() + .parseTimeStep(at.getAttribute(time_step).getValueAt(0)); time.setStep(new Double(step.get(0)).doubleValue()); time.setStepUnit(Time.findStepUnit(step.get(1)) .getDurationUnit()); @@ -264,20 +266,26 @@ class OpenDAPMetaDataParser extends MetaDataParser { try { AttributeTable at = das.getAttributeTable(lat); // ny - gridCoverage.setNy(new Integer(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(size).getValueAt(0))).intValue()); + gridCoverage.setNy(new Integer(OpenDAPParseUtility + .getInstance() + .trim(at.getAttribute(size).getValueAt(0))).intValue()); // dy - gridCoverage.setDy(new Float(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(resolution).getValueAt(0))).floatValue()); + gridCoverage.setDy(new Float(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(resolution).getValueAt(0))) + .floatValue()); // first latitude point - gridCoverage.setLa1(new Double(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(minimum).getValueAt(0))).doubleValue()); + gridCoverage.setLa1(new Double(OpenDAPParseUtility + .getInstance().trim( + at.getAttribute(minimum).getValueAt(0))) + .doubleValue()); - upperLeft.y = new Double(OpenDAPParseUtility.getInstance().trim(at.getAttribute( - maximum).getValueAt(0))).doubleValue(); + upperLeft.y = new Double(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(maximum).getValueAt(0))) + .doubleValue(); - lowerRight.y = new Double(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(minimum).getValueAt(0))).doubleValue(); + lowerRight.y = new Double(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(minimum).getValueAt(0))) + .doubleValue(); } catch (Exception le) { logParsingException(lat, "Latitude", collectionName, url); @@ -288,17 +296,21 @@ class OpenDAPMetaDataParser extends MetaDataParser { try { AttributeTable at = das.getAttributeTable(lon); // nx - gridCoverage.setNx(new Integer(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(size).getValueAt(0))).intValue()); + gridCoverage.setNx(new Integer(OpenDAPParseUtility + .getInstance() + .trim(at.getAttribute(size).getValueAt(0))).intValue()); // dx - gridCoverage.setDx(new Float(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(resolution).getValueAt(0))).floatValue()); + gridCoverage.setDx(new Float(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(resolution).getValueAt(0))) + .floatValue()); // min Lon - double minLon = new Double(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(minimum).getValueAt(0))).doubleValue(); + double minLon = new Double(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(minimum).getValueAt(0))) + .doubleValue(); // max Lon - double maxLon = new Double(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(maximum).getValueAt(0))).doubleValue(); + double maxLon = new Double(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(maximum).getValueAt(0))) + .doubleValue(); gridCoverage.setLo1(minLon); upperLeft.x = minLon; @@ -312,12 +324,13 @@ class OpenDAPMetaDataParser extends MetaDataParser { if (das.getAttributeTable(lev) != null) { try { AttributeTable at = das.getAttributeTable(lev); - dz = new Double(OpenDAPParseUtility.getInstance().trim(at.getAttribute( - resolution).getValueAt(0))).doubleValue(); - levMin = new Float(OpenDAPParseUtility.getInstance().trim(at.getAttribute( - minimum).getValueAt(0))).floatValue(); - levMax = new Float(OpenDAPParseUtility.getInstance().trim(at.getAttribute( - maximum).getValueAt(0))).floatValue(); + dz = new Double(OpenDAPParseUtility.getInstance().trim( + at.getAttribute(resolution).getValueAt(0))) + .doubleValue(); + levMin = new Float(OpenDAPParseUtility.getInstance().trim( + at.getAttribute(minimum).getValueAt(0))).floatValue(); + levMax = new Float(OpenDAPParseUtility.getInstance().trim( + at.getAttribute(maximum).getValueAt(0))).floatValue(); hasLevels = true; } catch (Exception le) { @@ -329,10 +342,11 @@ class OpenDAPMetaDataParser extends MetaDataParser { try { AttributeTable at = das.getAttributeTable(nc_global); dataSet.setDataSetType(DataType - .valueOfIgnoreCase(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(data_type).getValueAt(0)))); + .valueOfIgnoreCase(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(data_type).getValueAt(0)))); String description = at.getAttribute(title).getValueAt(0); - gdsmd.setDataSetDescription(OpenDAPParseUtility.getInstance().trim(description)); + gdsmd.setDataSetDescription(OpenDAPParseUtility.getInstance() + .trim(description)); } catch (Exception ne) { logParsingException(nc_global, "Global Dataset Info", collectionName, url); @@ -361,7 +375,7 @@ class OpenDAPMetaDataParser extends MetaDataParser { // regular parameter parsing try { - AttributeTable at = das.getAttributeTable(name); + AttributeTable at = das.getAttributeTable(name); Parameter parm = new Parameter(); parm.setDataType(dataSet.getDataSetType()); @@ -387,8 +401,8 @@ class OpenDAPMetaDataParser extends MetaDataParser { // descriptions, default fill, or missing vals. String description = "unknown description"; try { - description = OpenDAPParseUtility.getInstance().trim(at - .getAttribute(long_name).getValueAt(0)); + description = OpenDAPParseUtility.getInstance().trim( + at.getAttribute(long_name).getValueAt(0)); } catch (Exception iae) { statusHandler.handle(Priority.PROBLEM, @@ -396,11 +410,13 @@ class OpenDAPMetaDataParser extends MetaDataParser { } parm.setDefinition(description); - parm.setUnits(OpenDAPParseUtility.getInstance().parseUnits(description)); + parm.setUnits(OpenDAPParseUtility.getInstance().parseUnits( + description)); try { - parm.setMissingValue(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(missing_value).getValueAt(0))); + parm.setMissingValue(OpenDAPParseUtility.getInstance() + .trim(at.getAttribute(missing_value) + .getValueAt(0))); } catch (Exception iae) { statusHandler.handle(Priority.PROBLEM, "Invalid DAP missing value block! " + name); @@ -408,8 +424,9 @@ class OpenDAPMetaDataParser extends MetaDataParser { } try { - parm.setFillValue(OpenDAPParseUtility.getInstance().trim(at - .getAttribute(fill_value).getValueAt(0))); + parm.setFillValue(OpenDAPParseUtility + .getInstance() + .trim(at.getAttribute(fill_value).getValueAt(0))); } catch (Exception iae) { statusHandler.handle(Priority.PROBLEM, "Invalid DAP fill value block! " + name); @@ -610,7 +627,7 @@ class OpenDAPMetaDataParser extends MetaDataParser { } if (type == null) { - type = new DataLevelType(LevelType.UNKNOWN); + type = new DataLevelType(LevelType.UNKNOWN); } } @@ -640,8 +657,8 @@ class OpenDAPMetaDataParser extends MetaDataParser { List vals = null; try { - vals = OpenDAPParseUtility.getInstance().getDataSetNameAndCycle(linkKey, - collection.getName()); + vals = OpenDAPParseUtility.getInstance() + .getDataSetNameAndCycle(linkKey, collection.getName()); } catch (Exception e1) { statusHandler.handle(Priority.PROBLEM, "Failed to get cycle and dataset name set...", e1); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/ACARSDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/ACARSDecoder.java index 976118232b..981f9e85b4 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/ACARSDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/ACARSDecoder.java @@ -114,7 +114,7 @@ public class ACARSDecoder extends AbstractDecoder { public static final void main(String [] args) { - com.raytheon.edex.util.Util.isEmptyString(" "); + com.raytheon.uf.common.util.StringUtil.isEmptyString(" "); ACARSRecord r = new ACARSRecord("/acars/2011-03-21_17:58:32.0/2TPYR4JA/null/42.85/-84.92/9754"); System.out.println(r.getLatitude()); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetSeparator.java index af210f86ed..1d19dd8a54 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetSeparator.java @@ -25,7 +25,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; public class AirmetSeparator extends AbstractRecordSeparator { private final Log logger = LogFactory.getLog(getClass()); @@ -82,7 +82,7 @@ public class AirmetSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfSeparator.java index 51dd7df590..7f20ac940b 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfSeparator.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * @@ -105,7 +105,7 @@ public class AtcfSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.aww/src/gov/noaa/nws/ncep/edex/plugin/aww/decoder/AwwSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.aww/src/gov/noaa/nws/ncep/edex/plugin/aww/decoder/AwwSeparator.java index 3fc70aef61..9445f87027 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.aww/src/gov/noaa/nws/ncep/edex/plugin/aww/decoder/AwwSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.aww/src/gov/noaa/nws/ncep/edex/plugin/aww/decoder/AwwSeparator.java @@ -30,7 +30,7 @@ import org.apache.log4j.Logger; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; public class AwwSeparator extends AbstractRecordSeparator { private final Logger log = Logger.getLogger(getClass().getName()); @@ -98,7 +98,7 @@ public class AwwSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.convsigmet/src/gov/noaa/nws/ncep/edex/plugin/convsigmet/decoder/ConvSigmetSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.convsigmet/src/gov/noaa/nws/ncep/edex/plugin/convsigmet/decoder/ConvSigmetSeparator.java index da0b868bd5..4d4e5a6b71 100755 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.convsigmet/src/gov/noaa/nws/ncep/edex/plugin/convsigmet/decoder/ConvSigmetSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.convsigmet/src/gov/noaa/nws/ncep/edex/plugin/convsigmet/decoder/ConvSigmetSeparator.java @@ -25,7 +25,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; public class ConvSigmetSeparator extends AbstractRecordSeparator { private final Log logger = LogFactory.getLog(getClass()); @@ -82,7 +82,7 @@ public class ConvSigmetSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ffg/src/gov/noaa/nws/ncep/edex/plugin/ffg/decoder/FfgSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ffg/src/gov/noaa/nws/ncep/edex/plugin/ffg/decoder/FfgSeparator.java index c64f8a0e25..f121e621c4 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ffg/src/gov/noaa/nws/ncep/edex/plugin/ffg/decoder/FfgSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ffg/src/gov/noaa/nws/ncep/edex/plugin/ffg/decoder/FfgSeparator.java @@ -31,7 +31,7 @@ import org.apache.log4j.Logger; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; public class FfgSeparator extends AbstractRecordSeparator { @@ -89,7 +89,7 @@ public class FfgSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/decoder/IdftSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/decoder/IdftSeparator.java index 86c25ba8dd..1074699268 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/decoder/IdftSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/decoder/IdftSeparator.java @@ -36,7 +36,7 @@ import org.apache.log4j.Logger; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; public class IdftSeparator extends AbstractRecordSeparator { @@ -114,7 +114,7 @@ public class IdftSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); @@ -145,7 +145,7 @@ public class IdftSeparator extends AbstractRecordSeparator { public byte[] getRecord() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); @@ -163,7 +163,7 @@ public class IdftSeparator extends AbstractRecordSeparator { public byte[] getBulletin() { try { String temp = bulIterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.intlsigmet/src/gov/noaa/nws/ncep/edex/plugin/intlsigmet/decoder/IntlSigmetSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.intlsigmet/src/gov/noaa/nws/ncep/edex/plugin/intlsigmet/decoder/IntlSigmetSeparator.java index ccb86b4310..a1fac87813 100755 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.intlsigmet/src/gov/noaa/nws/ncep/edex/plugin/intlsigmet/decoder/IntlSigmetSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.intlsigmet/src/gov/noaa/nws/ncep/edex/plugin/intlsigmet/decoder/IntlSigmetSeparator.java @@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; public class IntlSigmetSeparator extends AbstractRecordSeparator { private final Log logger = LogFactory.getLog(getClass()); @@ -88,7 +88,7 @@ public class IntlSigmetSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncccfp/src/gov/noaa/nws/ncep/edex/plugin/ncccfp/decoder/NcccfpSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncccfp/src/gov/noaa/nws/ncep/edex/plugin/ncccfp/decoder/NcccfpSeparator.java index 379e3d0130..711bd55382 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncccfp/src/gov/noaa/nws/ncep/edex/plugin/ncccfp/decoder/NcccfpSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncccfp/src/gov/noaa/nws/ncep/edex/plugin/ncccfp/decoder/NcccfpSeparator.java @@ -12,7 +12,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * @@ -91,7 +91,7 @@ public class NcccfpSeparator extends AbstractRecordSeparator { public String next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return ""; } else { return temp; diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgridAssembler.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgridAssembler.java index 45d8b7769b..3499362a6c 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgridAssembler.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgridAssembler.java @@ -47,6 +47,7 @@ import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.util.FileUtil; +import com.raytheon.uf.common.util.GridUtil; import com.raytheon.uf.common.util.file.FilenameFilters; import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.plugin.PluginFactory; @@ -80,7 +81,7 @@ public class NcgridAssembler { */ public NcgridAssembler() { if (ncthinnedModels == null) { - //System.out.println(" load nc thin models commonPath:"); + // System.out.println(" load nc thin models commonPath:"); loadNcThinnedModels(); } @@ -95,23 +96,24 @@ public class NcgridAssembler { File commonPath = pm.getFile(pm.getContext( LocalizationType.EDEX_STATIC, LocalizationLevel.BASE), "/ncgrib/ncthinnedModels"); - - //System.out.println(" load thin models commonPath=" + commonPath); + + // System.out.println(" load thin models commonPath=" + commonPath); FilenameFilter filter = FilenameFilters.byFilters( FilenameFilters.ACCEPT_FILES, FilenameFilters.byFileExtension(".xml")); - List thinnedModelFiles = FileUtil.listFiles(commonPath, - filter, false); + List thinnedModelFiles = FileUtil.listFiles(commonPath, filter, + false); for (File file : thinnedModelFiles) { - //System.out.println(" load thin models file=" + file.getName()); + // System.out.println(" load thin models file=" + file.getName()); try { NccompositeModel model = (NccompositeModel) SerializationUtil .jaxbUnmarshalFromXmlFile(file.getPath()); - //System.out.println(" load thin models model=" + model.getModelName()); + // System.out.println(" load thin models model=" + + // model.getModelName()); ncthinnedModels.put(model.getModelName(), model); } catch (SerializationException e) { @@ -199,15 +201,15 @@ public class NcgridAssembler { * @return The new grib record * @throws Exception */ - private NcgribRecord processGrid(NcgribRecord record, NccompositeModel thinned) - throws Exception { + private NcgribRecord processGrid(NcgribRecord record, + NccompositeModel thinned) throws Exception { - NcgribDao dao = (NcgribDao) PluginFactory.getInstance() - .getPluginDao("ncgrib"); + NcgribDao dao = (NcgribDao) PluginFactory.getInstance().getPluginDao( + "ncgrib"); String modelName = record.getModelInfo().getModelName(); String dataURI = record.getDataURI(); - String assembledDataURI = dataURI.replace(modelName, thinned - .getModelName()); + String assembledDataURI = dataURI.replace(modelName, + thinned.getModelName()); List result = dao.queryBySingleCriteria("dataURI", assembledDataURI); NcgribRecord assembledRecord = null; @@ -240,8 +242,9 @@ public class NcgridAssembler { * @return The composite NcgribRecord * @throws Exception */ - private NcgribRecord mergeData(NcgribRecord record, NcgribRecord assembledRecord, - NcgribDao dao, NccompositeModel thinned) throws Exception { + private NcgribRecord mergeData(NcgribRecord record, + NcgribRecord assembledRecord, NcgribDao dao, + NccompositeModel thinned) throws Exception { String modelName = record.getModelInfo().getModelName(); NcgridCoverage coverage = record.getModelInfo().getLocation(); @@ -264,9 +267,11 @@ public class NcgridAssembler { "Error assembling ncgrids. Thinned ncgrid definition does not contain " + modelName); } - Util.insertSubgrid(assembledData, Util.resizeDataTo2D((float[]) record - .getMessageData(), coverage.getNx(), coverage.getNy()), nx - * modIndex, 0, nx, ny); + Util.insertSubgrid( + assembledData, + Util.resizeDataTo2D((float[]) record.getMessageData(), + coverage.getNx(), coverage.getNy()), nx * modIndex, 0, + nx, ny); assembledRecord.setMessageData(Util.resizeDataTo1D(assembledData, (int) sizes[1], (int) sizes[0])); @@ -279,8 +284,8 @@ public class NcgridAssembler { * Creates the composite grib record and stores it to the HDF5 repository * * @param record - * The recieved NcgribRecord used to initialize the composite grid - * with + * The recieved NcgribRecord used to initialize the composite + * grid with * @param dao * An instance of the grib data access object * @param thinned @@ -296,8 +301,8 @@ public class NcgridAssembler { NcgridCoverage gridLoc = record.getModelInfo().getLocation(); float[] data = new float[(gridLoc.getNx() * 4) * gridLoc.getNy()]; - for(int i = 0; i < data.length;i++){ - data[i] = Util.GRID_FILL_VALUE; + for (int i = 0; i < data.length; i++) { + data[i] = GridUtil.GRID_FILL_VALUE; } NcgribRecord newRecord = new NcgribRecord(); NcgribModel newModel = new NcgribModel(record.getModelInfo()); @@ -310,8 +315,8 @@ public class NcgridAssembler { try { newModel = NcgribModelCache.getInstance().getModel(newModel); } catch (DataAccessLayerException e) { - throw new GribException("Unable to get ncep model info from the cache!", - e); + throw new GribException( + "Unable to get ncep model info from the cache!", e); } newRecord.setModelInfo(newModel); newRecord.setMessageData(data); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/uengine/tasks/ncgrib/NcgribMap.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/uengine/tasks/ncgrib/NcgribMap.java index c5250dfe87..8d162294fe 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/uengine/tasks/ncgrib/NcgribMap.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/uengine/tasks/ncgrib/NcgribMap.java @@ -40,8 +40,8 @@ import org.geotools.coverage.grid.GridGeometry2D; import com.raytheon.edex.colormap.ColorMapManager; import com.raytheon.edex.uengine.tasks.ScriptTask; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.datastorage.records.IDataRecord; +import com.raytheon.uf.common.util.GridUtil; /** * GribMap task derived from original uEngine GribMap task. Maps grid data to an @@ -163,7 +163,7 @@ public class NcgribMap extends ScriptTask { int pixels = gribData.length; for (int i = 0; i < pixels; i++) { - if (gribData[i] != Util.GRID_FILL_VALUE) { + if (gribData[i] != GridUtil.GRID_FILL_VALUE) { if (max < gribData[i]) { max = gribData[i]; } diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncpafm/src/gov/noaa/nws/ncep/edex/plugin/ncpafm/decoder/NcPafmSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncpafm/src/gov/noaa/nws/ncep/edex/plugin/ncpafm/decoder/NcPafmSeparator.java index ed4bb60751..069966d630 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncpafm/src/gov/noaa/nws/ncep/edex/plugin/ncpafm/decoder/NcPafmSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncpafm/src/gov/noaa/nws/ncep/edex/plugin/ncpafm/decoder/NcPafmSeparator.java @@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; public class NcPafmSeparator extends AbstractRecordSeparator { @@ -97,7 +97,7 @@ public class NcPafmSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/decoder/NcScdSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/decoder/NcScdSeparator.java index a880cb9791..4c5bde4124 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/decoder/NcScdSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/decoder/NcScdSeparator.java @@ -38,7 +38,7 @@ import org.apache.log4j.Logger; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; public class NcScdSeparator extends AbstractRecordSeparator { @@ -91,7 +91,7 @@ public class NcScdSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairSeparator.java index bef28082a7..d54773d744 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairSeparator.java @@ -23,15 +23,16 @@ package gov.noaa.nws.ncep.edex.plugin.ncuair.decoder; import java.util.ArrayList; - import java.util.Iterator; - import java.util.List; - import java.util.NoSuchElementException; - import java.util.regex.Matcher; - import java.util.regex.Pattern; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import com.raytheon.edex.esb.Headers; - import com.raytheon.edex.plugin.AbstractRecordSeparator; - import com.raytheon.edex.util.Util; +import com.raytheon.edex.plugin.AbstractRecordSeparator; +import com.raytheon.uf.common.util.StringUtil; + import org.apache.log4j.Logger; public class NcUairSeparator extends AbstractRecordSeparator { @@ -108,7 +109,7 @@ import org.apache.log4j.Logger; public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[])null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.nonconvsigmet/src/gov/noaa/nws/ncep/edex/plugin/nonconvsigmet/decoder/NonConvSigmetSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.nonconvsigmet/src/gov/noaa/nws/ncep/edex/plugin/nonconvsigmet/decoder/NonConvSigmetSeparator.java index fd886b8437..f9c15b005f 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.nonconvsigmet/src/gov/noaa/nws/ncep/edex/plugin/nonconvsigmet/decoder/NonConvSigmetSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.nonconvsigmet/src/gov/noaa/nws/ncep/edex/plugin/nonconvsigmet/decoder/NonConvSigmetSeparator.java @@ -25,7 +25,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; public class NonConvSigmetSeparator extends AbstractRecordSeparator { private final Log logger = LogFactory.getLog(getClass()); @@ -88,7 +88,7 @@ public class NonConvSigmetSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackSeparator.java index 925dc48c0e..ecc7afcb7a 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackSeparator.java @@ -23,7 +23,8 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; + import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; /** @@ -107,7 +108,7 @@ public class StormTrackSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmSeparator.java index f71cb4de51..1497c477aa 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmSeparator.java @@ -29,7 +29,7 @@ import org.apache.log4j.Logger; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; public class TcmSeparator extends AbstractRecordSeparator { @@ -100,7 +100,7 @@ public class TcmSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpSeparator.java index 01c946df6a..74c727eaf3 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpSeparator.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; /** * @@ -113,7 +113,7 @@ public class WcpSeparator extends AbstractRecordSeparator { public byte[] next() { try { String temp = iterator.next(); - if (Util.isEmptyString(temp)) { + if (StringUtil.isEmptyString(temp)) { return (byte[]) null; } else { return temp.getBytes(); diff --git a/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/output/GridOut.java b/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/output/GridOut.java index 6101096975..37bab0c2fc 100644 --- a/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/output/GridOut.java +++ b/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/output/GridOut.java @@ -9,7 +9,7 @@ import java.util.UUID; import com.raytheon.edex.uengine.exception.MicroEngineException; import com.raytheon.edex.uengine.tasks.ScriptTask; -import com.raytheon.edex.util.Util; +import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.props.EnvProperties; import com.raytheon.uf.edex.core.props.PropertiesFactory; @@ -65,7 +65,7 @@ public class GridOut extends ScriptTask { /* * make sure there is an output directory defined */ - if (Util.isEmptyString(destDir)) { + if (StringUtil.isEmptyString(destDir)) { // default to uengineOutDir destDir = uengineOutDir; // logger.debug("Defaulting destDir to: " + destDir); @@ -91,7 +91,7 @@ public class GridOut extends ScriptTask { // get the URI for the image out String suffix = "." + format; - if (uri != null && !Util.isEmptyString(uri.toString())) { + if (uri != null && !StringUtil.isEmptyString(uri.toString())) { destFile = new File(uri).getName(); if (!destFile.endsWith(suffix)) { destFile += suffix;
Subscription results: