Tabnine Logo
StringUtil2.cleanup
Code IndexAdd Tabnine to your IDE (free)

How to use
cleanup
method
in
ucar.unidata.util.StringUtil2

Best Java code snippets using ucar.unidata.util.StringUtil2.cleanup (Showing top 16 results out of 315)

origin: edu.ucar/netcdf

public static String cleanup(String s) {
 if (s == null) return null;
 return cleanup(s.getBytes(CDM.utf8Charset));
}
origin: edu.ucar/cdm

public static String cleanup(String s) {
 if (s == null) return null;
 return cleanup(s.getBytes(CDM.utf8Charset));
}
origin: Unidata/thredds

public static String cleanup(String s) {
 if (s == null) return null;
 return cleanup(s.getBytes(CDM.utf8Charset));
}
origin: Unidata/thredds

static public String cleanupHeader(byte[] raw) {
 String result = StringUtil2.cleanup(raw);
 int pos = result.indexOf("data");
 if (pos > 0) result = result.substring(pos);
 return result;
}
origin: Unidata/thredds

 private Param(int pnum, String desc, String unit, String name) {
  this.pnum = pnum;
  this.desc = desc;
  this.unit = StringUtil2.cleanup(unit);
  this.name = StringUtil2.cleanup(name);
 }
}
origin: Unidata/thredds

 private Param(int pnum, String desc, String unit, String name) {
  this.pnum = pnum;
  this.desc = desc;
  this.unit = StringUtil2.cleanup(unit);
  this.name = StringUtil2.cleanup(name);
 }
}
origin: Unidata/thredds

private boolean checkEnding(long ending) throws IOException {
 // check that end section = "7777" is correct
 raf.seek(ending - 4);
 for (int i = 0; i < 4; i++) {
  if (raf.read() != 55) {
   String clean = StringUtil2.cleanup(header);
   if (clean.length() > 40) clean = clean.substring(0, 40) + "...";
   log.debug("Missing End of GRIB message at pos=" + ending + " header= " + clean + " for=" + raf.getLocation());
   return false;
  }
 }
 return true;
}
origin: Unidata/thredds

private List<Param> readTable2(Element table) {
 List<Param> result = new ArrayList<>();
 Elements rows = table.select("tr");
 for (Element row : rows) {
  Elements cols = row.select("td");
  if (debug) {
   System.out.printf(" %d=", cols.size());
   for (Element col : cols)
    System.out.printf("%s:", col.text());
   System.out.printf("%n");
  }
  if (cols.size() == 4) {
   String snum = StringUtil2.cleanup(cols.get(0).text()).trim();
   try {
    int pnum = Integer.parseInt(snum);
    String desc = StringUtil2.cleanup(cols.get(1).text()).trim();
    if (desc.startsWith("Reserved")) {
     System.out.printf("*** Skip Reserved %s%n", row.text());
     continue;
    }
    result.add(new Param(pnum, desc, cols.get(2).text(), cols.get(3).text()));
   } catch (NumberFormatException e) {
    System.out.printf("*** Cant parse %s == %s%n", snum, row.text());
   }
  }
 }
 return result;
}
origin: Unidata/thredds

String snum = StringUtil2.cleanup(cols.get(0).text()).trim();
try {
 int pnum = Integer.parseInt(snum);
 String desc = StringUtil2.cleanup(cols.get(1).text()).trim();
 String abbrev = StringUtil2.cleanup(cols.get(2).text()).trim();
 if (desc.startsWith("Reserved")) {
  System.out.printf("*** Skip Reserved %s%n", row.text());
origin: Unidata/thredds

String snum = StringUtil2.cleanup(cols.get(0).text()).trim();
String desc = StringUtil2.cleanup(cols.get(1).text()).trim();
if (snum.contains("Reserved") || desc.contains("Reserved") ) {
 if (debug) System.out.printf("*** Skip Reserved %s%n", row.text());
origin: Unidata/thredds

String snum = StringUtil2.cleanup(cols.get(0).text()).trim();
try {
 int pnum = Integer.parseInt(snum);
 String desc = StringUtil2.cleanup(cols.get(1).text()).trim();
 if (desc.startsWith("Reserved")) {
  System.out.printf("*** Skip Reserved %s%n", row.text());
origin: Unidata/thredds

String snum = StringUtil2.cleanup(cols.get(0).text()).trim();
String desc = StringUtil2.cleanup(cols.get(1).text()).trim();
if (snum.contains("Reserved") || desc.contains("Reserved") || desc.contains("Missing") ) {
 if (debugParam) System.out.printf("*** Skip Reserved %s%n", row.text());
String snum = StringUtil2.cleanup(cols.get(0).text()).trim();
String desc = StringUtil2.cleanup(cols.get(1).text()).trim();
if (snum.contains("Reserved") || desc.contains("Reserved") || desc.contains("Missing") ) {
 if (debugParam) System.out.printf("*** Skip Reserved %s%n", row.text());
origin: Unidata/thredds

public void check(RandomAccessFile raf, Formatter f) throws IOException {
 long messLen = is.getMessageLength();
 long startPos = is.getStartPos();
 long endPos = is.getEndPos();
 if (endPos > raf.length()) {
  f.format("End of GRIB message (start=%d len=%d) end=%d > file.length=%d for %s%n", startPos, messLen , endPos, raf.length(), raf.getLocation());
  return;
 }
 raf.seek(endPos-4);
 for (int i = 0; i < 4; i++) {
  if (raf.read() != 55) {
   String clean = StringUtil2.cleanup(header);
   if (clean.length() > 40) clean = clean.substring(0,40) + "...";
   f.format("Missing End of GRIB message (start=%d len=%d) end=%d header= %s for %s (len=%d)%n", startPos, messLen, endPos, clean, raf.getLocation(), raf.length());
   break;
  }
 }
 long dataLen = dataSection.getMsgLength();
 long dataStart = dataSection.getStartingPosition();
 long dataEnd = dataStart + dataLen;
 if (dataEnd > raf.length()) {
  f.format("GRIB data section (start=%d len=%d) end=%d > file.length=%d for %s%n", dataStart, dataLen, dataEnd, raf.length(), raf.getLocation());
  return;
 }
 if (dataEnd > endPos) {
  f.format("GRIB data section (start=%d len=%d) end=%d > message end=%d for %s%n", dataStart, dataLen, dataEnd, endPos, raf.getLocation());
 }
}
origin: Unidata/thredds

log.warn("BAD GRIB-1 data message at " + dataSection.getStartingPosition() + " header= " + StringUtil2.cleanup(header)+" for="+raf.getLocation());
throw new IllegalStateException("Illegal Grib1SectionBinaryData Message Length");
origin: Unidata/thredds

if (debug) System.out.printf(" read until %d grib ending at %d header ='%s'%n", raf.getFilePointer(), ending, StringUtil2.cleanup(header));
    raf.getFilePointer(), ending, StringUtil2.cleanup(header), foundEnding);
origin: Unidata/thredds

if (debug) System.out.printf(" REPEAT read until %d grib ending at %d header ='%s'%n", raf.getFilePointer(), ending, StringUtil2.cleanup(header));
for (int i = 0; i < 4; i++) {
 if (raf.read() != 55) {
  String clean = StringUtil2.cleanup(header);
  if (clean.length() > 40) clean = clean.substring(0,40) + "...";
  log.warn("  REPEAT Missing End of GRIB message at pos=" + ending + " header= " + clean+" for="+raf.getLocation());
ucar.unidata.utilStringUtil2cleanup

Javadoc

Delete any non-printable characters

Popular methods of StringUtil2

  • replace
    Replace any of the characters from out with corresponding character from in
  • remove
    Remove any of the characters in out from sb
  • substitute
    Find all occurences of the "match" in original, and substitute the "subst" string, directly into the
  • splitString
    Split a string on one or more whitespace. Cover for String.split, because who can remember regexp?
  • unescape
    This finds any '%xx' and converts to the equivalent char. Inverse of escape().
  • collapseWhitespace
    Collapse continuous whitespace into one single " ".
  • allow
    Replace any char not alphanumeric or in allowChars by replaceChar.
  • breakTextAtWords
    Break the given text into lines, respecting word boundaries (blank space).
  • escape
    Escape any char not alphanumeric or in okChars. Escape by replacing char with %xx (hex).
  • getTokens
  • makeValidCdmObjectName
  • padLeft
    Pad the given string with padString on the left up to the given length.
  • makeValidCdmObjectName,
  • padLeft,
  • padRight,
  • quoteHtmlContent,
  • unreplace,
  • filter7bits,
  • match,
  • quoteXmlAttribute,
  • removeFromEnd

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now