private static TextParseException parseException(String str, String message) { return new TextParseException("'" + str + "': " + message); }
private static TextParseException parseException(String str, String message) { return new TextParseException("'" + str + "': " + message); }
private static TextParseException parseException(String str, String message) { return new TextParseException("'" + str + "': " + message); }
private static TextParseException parseException(String str, String message) { return new TextParseException("'" + str + "': " + message); }
throw new TextParseException("text string too long"); intval += (b - '0'); if (intval > 255) throw new TextParseException ("bad escape"); if (digits < 3) throw new TextParseException("bad escape"); os.write(b); escaped = false; throw new TextParseException("bad escape"); array = os.toByteArray(); if (array.length > 255) { throw new TextParseException("text string too long");
throw new TextParseException("text string too long"); intval += (b - '0'); if (intval > 255) throw new TextParseException ("bad escape"); if (digits < 3) throw new TextParseException("bad escape"); os.write(b); escaped = false; throw new TextParseException("bad escape"); array = os.toByteArray(); if (array.length > 255) { throw new TextParseException("text string too long");
throw new TextParseException("text string too long"); intval += (b - '0'); if (intval > 255) throw new TextParseException ("bad escape"); if (digits < 3) throw new TextParseException("bad escape"); os.write(b); escaped = false; throw new TextParseException("bad escape"); array = os.toByteArray(); if (array.length > 255) { throw new TextParseException("text string too long");
throw new TextParseException("text string too long"); intval += (b - '0'); if (intval > 255) throw new TextParseException ("bad escape"); if (digits < 3) throw new TextParseException("bad escape"); os.write(b); escaped = false; throw new TextParseException("bad escape"); array = os.toByteArray(); if (array.length > 255) { throw new TextParseException("text string too long");
/** * Parses a formatted time string into a Date. * @param s The string, in the form YYYYMMDDHHMMSS. * @return The Date object. * @throws TextParseExcetption The string was invalid. */ public static Date parse(String s) throws TextParseException { if (s.length() != 14) { throw new TextParseException("Invalid time encoding: " + s); } Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); c.clear(); try { int year = Integer.parseInt(s.substring(0, 4)); int month = Integer.parseInt(s.substring(4, 6)) - 1; int date = Integer.parseInt(s.substring(6, 8)); int hour = Integer.parseInt(s.substring(8, 10)); int minute = Integer.parseInt(s.substring(10, 12)); int second = Integer.parseInt(s.substring(12, 14)); c.set(year, month, date, hour, minute, second); } catch (NumberFormatException e) { throw new TextParseException("Invalid time encoding: " + s); } return c.getTime(); }
/** * Parses a formatted time string into a Date. * @param s The string, in the form YYYYMMDDHHMMSS. * @return The Date object. * @throws TextParseExcetption The string was invalid. */ public static Date parse(String s) throws TextParseException { Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); if (s.length() != 14) { throw new TextParseException("Invalid time encoding: " + s); } try { int year = Integer.parseInt(s.substring(0, 4)); int month = Integer.parseInt(s.substring(4, 6)) - 1; int date = Integer.parseInt(s.substring(6, 8)); int hour = Integer.parseInt(s.substring(8, 10)); int minute = Integer.parseInt(s.substring(10, 12)); int second = Integer.parseInt(s.substring(12, 14)); c.set(year, month, date, hour, minute, second); } catch (NumberFormatException e) { throw new TextParseException("Invalid time encoding: " + s); } return c.getTime(); }
/** * Parses a formatted time string into a Date. * @param s The string, in the form YYYYMMDDHHMMSS. * @return The Date object. * @throws TextParseExcetption The string was invalid. */ public static Date parse(String s) throws TextParseException { if (s.length() != 14) { throw new TextParseException("Invalid time encoding: " + s); } Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); c.clear(); try { int year = Integer.parseInt(s.substring(0, 4)); int month = Integer.parseInt(s.substring(4, 6)) - 1; int date = Integer.parseInt(s.substring(6, 8)); int hour = Integer.parseInt(s.substring(8, 10)); int minute = Integer.parseInt(s.substring(10, 12)); int second = Integer.parseInt(s.substring(12, 14)); c.set(year, month, date, hour, minute, second); } catch (NumberFormatException e) { throw new TextParseException("Invalid time encoding: " + s); } return c.getTime(); }
/** * Parses a formatted time string into a Date. * @param s The string, in the form YYYYMMDDHHMMSS. * @return The Date object. * @throws TextParseExcetption The string was invalid. */ public static Date parse(String s) throws TextParseException { if (s.length() != 14) { throw new TextParseException("Invalid time encoding: " + s); } Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC")); c.clear(); try { int year = Integer.parseInt(s.substring(0, 4)); int month = Integer.parseInt(s.substring(4, 6)) - 1; int date = Integer.parseInt(s.substring(6, 8)); int hour = Integer.parseInt(s.substring(8, 10)); int minute = Integer.parseInt(s.substring(10, 12)); int second = Integer.parseInt(s.substring(12, 14)); c.set(year, month, date, hour, minute, second); } catch (NumberFormatException e) { throw new TextParseException("Invalid time encoding: " + s); } return c.getTime(); }
} else if (c == '\\') { if (i + 1 == str.length) throw new TextParseException ("invalid escape character"); escaped = true; break; if (c < '0' || c > '9') throw new TextParseException( "invalid offset"); c -= '0'; if (c < '0' || c > '9') throw new TextParseException( "invalid width"); c -= '0'; throw new TextParseException( "invalid base"); c = (char)(str[++i] & 0xFF); throw new TextParseException( "invalid base"); throw new TextParseException ("invalid modifiers"); i++;
} else if (c == '\\') { if (i + 1 == str.length) throw new TextParseException ("invalid escape character"); escaped = true; break; if (c < '0' || c > '9') throw new TextParseException( "invalid offset"); c -= '0'; if (c < '0' || c > '9') throw new TextParseException( "invalid width"); c -= '0'; throw new TextParseException( "invalid base"); c = (char)(str[++i] & 0xFF); throw new TextParseException( "invalid base"); throw new TextParseException ("invalid modifiers"); i++;
} else if (c == '\\') { if (i + 1 == str.length) throw new TextParseException ("invalid escape character"); escaped = true; break; if (c < '0' || c > '9') throw new TextParseException( "invalid offset"); c -= '0'; if (c < '0' || c > '9') throw new TextParseException( "invalid width"); c -= '0'; throw new TextParseException( "invalid base"); c = (char)(str[++i] & 0xFF); throw new TextParseException( "invalid base"); throw new TextParseException ("invalid modifiers"); i++;
throw new TextParseException("Name \"" + name + "\" is not an IETF RFC 2782 or IETF RFC 6763 compliant service name.");
void rdataFromString(Tokenizer st, Name origin) throws IOException { precedence = st.getUInt8(); gatewayType = st.getUInt8(); algorithmType = st.getUInt8(); switch (gatewayType) { case Gateway.None: String s = st.getString(); if (!s.equals(".")) throw new TextParseException("invalid gateway format"); gateway = null; break; case Gateway.IPv4: gateway = st.getAddress(Address.IPv4); break; case Gateway.IPv6: gateway = st.getAddress(Address.IPv6); break; case Gateway.Name: gateway = st.getName(origin); break; default: throw new WireParseException("invalid gateway type"); } key = st.getBase64(false); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { precedence = st.getUInt8(); gatewayType = st.getUInt8(); algorithmType = st.getUInt8(); switch (gatewayType) { case Gateway.None: String s = st.getString(); if (!s.equals(".")) throw new TextParseException("invalid gateway format"); gateway = null; break; case Gateway.IPv4: gateway = st.getAddress(Address.IPv4); break; case Gateway.IPv6: gateway = st.getAddress(Address.IPv6); break; case Gateway.Name: gateway = st.getName(origin); break; default: throw new WireParseException("invalid gateway type"); } key = st.getBase64(false); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { precedence = st.getUInt8(); gatewayType = st.getUInt8(); algorithmType = st.getUInt8(); switch (gatewayType) { case Gateway.None: String s = st.getString(); if (!s.equals(".")) throw new TextParseException("invalid gateway format"); gateway = null; break; case Gateway.IPv4: gateway = st.getAddress(Address.IPv4); break; case Gateway.IPv6: gateway = st.getAddress(Address.IPv6); break; case Gateway.Name: gateway = st.getName(origin); break; default: throw new WireParseException("invalid gateway type"); } key = st.getBase64(false); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { precedence = st.getUInt8(); gatewayType = st.getUInt8(); algorithmType = st.getUInt8(); switch (gatewayType) { case Gateway.None: String s = st.getString(); if (!s.equals(".")) throw new TextParseException("invalid gateway format"); gateway = null; break; case Gateway.IPv4: gateway = st.getAddress(Address.IPv4); break; case Gateway.IPv6: gateway = st.getAddress(Address.IPv6); break; case Gateway.Name: gateway = st.getName(origin); break; default: throw new WireParseException("invalid gateway type"); } key = st.getBase64(false); }