Issue #2142 remove more dependencies on edex.common

Change-Id: Iac9d21fc531c03920fcbb52d6a9cc833a2625a2f

Former-commit-id: f650a26ee4c6c944164d2b5d917b5f8b6ad32bb5
This commit is contained in:
Nate Jensen 2013-08-08 14:14:55 -05:00
parent b43b05fced
commit a919490d00
56 changed files with 326 additions and 301 deletions

View file

@ -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

View file

@ -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

View file

@ -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);
}
}
}

View file

@ -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",

View file

@ -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;

View file

@ -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;

View file

@ -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<Object, Object>((float) i, fdr));
}
if (cube.size() < 3) {

View file

@ -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,

View file

@ -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);

View file

@ -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,

View file

@ -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) {

View file

@ -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 {

View file

@ -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);

View file

@ -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();

View file

@ -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 &mu;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

View file

@ -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());
}
}

View file

@ -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() {

View file

@ -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;

View file

@ -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
*
*
* </pre>
*
* @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).<br>
* Example: printString("test") would display "[test]"<br>
* 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

View file

@ -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;

View file

@ -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();

View file

@ -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

View file

@ -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<String>();
logger.info("-subscription exists for "
+ Util.printString(dataURI));
+ StringUtil.printString(dataURI));
Configuration properties = PropertiesFactory.getInstance()
.getConfiguration(
ISubscriptionManager.CONFIGURATION_NAME);

View file

@ -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;

View file

@ -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<File> thinnedModelFiles = FileUtil.listFiles(commonPath,
filter, false);
List<File> 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 {

View file

@ -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];
}

View file

@ -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();

View file

@ -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();

View file

@ -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;

View file

@ -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.

View file

@ -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);

View file

@ -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());
}

View file

@ -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("<center><h2>No Data Available</h2></center><hr>");
try {
String subresp = getSubscriptionMsg(responseStr);
if (!Util.isEmptyString(subresp)) {
if (!StringUtil.isEmptyString(subresp)) {
out.println("<table>\n");
out.println("<tr><th colspan=2>Subscription results:</th></tr>\n");
out.println(subresp);
@ -1033,7 +1034,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
htmlStr.append("</tr></table></center>\n");
try {
String subresp = getSubscriptionMsg(responseStr);
if (!Util.isEmptyString(subresp)) {
if (!StringUtil.isEmptyString(subresp)) {
htmlStr.append("<table>\n");
htmlStr.append("<tr><th colspan=2>Subscription results:</th></tr>\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();

View file

@ -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<ParmID> {
return false;
}
if (!Util.isAlnum(parmName)) {
if (!StringUtil.isAlnum(parmName)) {
return false;
}
if (!Util.isAlnum(parmLevel)) {
if (!StringUtil.isAlnum(parmLevel)) {
return false;
}

View file

@ -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).<br>
* Example: printString("test") would display "[test]"<br>
* 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;
}
}
}

View file

@ -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<Integer> {
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<Integer> {
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<Integer> {
// 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<Integer> {
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<Integer> {
return vals;
}
@Override
public PluginDataObject getRecord(Integer index) {
if (pdos != null && index < pdos.length) {

View file

@ -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<Double> levelList = OpenDAPParseUtility.getInstance().parseLevels(gdsmd.getUrl(), serviceConfig.getConstantValue("LEV"));
List<Double> 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<String, Parameter> 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<String> step = OpenDAPParseUtility.getInstance().parseTimeStep(at
.getAttribute(time_step).getValueAt(0));
List<String> 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<String> 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);

View file

@ -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());

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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;

View file

@ -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<File> thinnedModelFiles = FileUtil.listFiles(commonPath,
filter, false);
List<File> 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);

View file

@ -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];
}

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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;