private int getToken(String s, int index) { while (index < s.length() && s.charAt(index) != '#' && !MimeType.isSpecial(s.charAt(index))) { index++; } return index; }
private int getToken(String s, int index) { while (index < s.length() && s.charAt(index) != '#' && !MimeType.isSpecial(s.charAt(index))) { index++; } return index; }
private int getToken(String s, int index) { while (index < s.length() && s.charAt(index) != '#' && !MimeType.isSpecial(s.charAt(index))) { index++; } return index; }
private int getToken(String s, int index) { while (index < s.length() && s.charAt(index) != '#' && !MimeType.isSpecial(s.charAt(index))) { index++; } return index; }
private static String parseToken(String tokenString) throws MimeTypeParseException { tokenString = tokenString.trim(); for (int i=0; i < tokenString.length(); i++) { char c = tokenString.charAt(i); if (isSpecial(c)) { throw new MimeTypeParseException("Special '" + c + "' not allowed in token"); } } return tokenString; } }
private String expectAttribute() throws MimeTypeParseException { char c; do { if (index == text.length()) { throw new MimeTypeParseException("Expected attribute at " + (index - 1) + " in " + text); } c = text.charAt(index++); } while (Character.isWhitespace(c)); int start = index - 1; while (index != text.length() && !MimeType.isSpecial(text.charAt(index))) { index += 1; } return text.substring(start, index); }
private static String parseToken(String tokenString) throws MimeTypeParseException { tokenString = tokenString.trim(); for (int i=0; i < tokenString.length(); i++) { char c = tokenString.charAt(i); if (isSpecial(c)) { throw new MimeTypeParseException("Special '" + c + "' not allowed in token"); } } return tokenString; } }
private static String parseToken(String tokenString) throws MimeTypeParseException { tokenString = tokenString.trim(); for (int i=0; i < tokenString.length(); i++) { char c = tokenString.charAt(i); if (isSpecial(c)) { throw new MimeTypeParseException("Special '" + c + "' not allowed in token"); } } return tokenString; } }
private String expectAttribute() throws MimeTypeParseException { char c; do { if (index == text.length()) { throw new MimeTypeParseException("Expected attribute at " + (index - 1) + " in " + text); } c = text.charAt(index++); } while (Character.isWhitespace(c)); int start = index - 1; while (index != text.length() && !MimeType.isSpecial(text.charAt(index))) { index += 1; } return text.substring(start, index); }
private String expectAttribute() throws MimeTypeParseException { char c; do { if (index == text.length()) { throw new MimeTypeParseException("Expected attribute at " + (index - 1) + " in " + text); } c = text.charAt(index++); } while (Character.isWhitespace(c)); int start = index - 1; while (index != text.length() && !MimeType.isSpecial(text.charAt(index))) { index += 1; } return text.substring(start, index); }
private void quote(StringBuffer buf, String value) { int length = value.length(); boolean quote = false; for (int i = 0; i < length; i++) { if (MimeType.isSpecial(value.charAt(i))) { quote = true; break; } } if (quote) { buf.append('"'); for (int i = 0; i < length; i++) { char c = value.charAt(i); if (c == '\\' || c == '"') { buf.append('\\'); } buf.append(c); } buf.append('"'); } else { buf.append(value); } }
private void quote(StringBuffer buf, String value) { int length = value.length(); boolean quote = false; for (int i = 0; i < length; i++) { if (MimeType.isSpecial(value.charAt(i))) { quote = true; break; } } if (quote) { buf.append('"'); for (int i = 0; i < length; i++) { char c = value.charAt(i); if (c == '\\' || c == '"') { buf.append('\\'); } buf.append(c); } buf.append('"'); } else { buf.append(value); } }
private void quote(StringBuffer buf, String value) { int length = value.length(); boolean quote = false; for (int i = 0; i < length; i++) { if (MimeType.isSpecial(value.charAt(i))) { quote = true; break; } } if (quote) { buf.append('"'); for (int i = 0; i < length; i++) { char c = value.charAt(i); if (c == '\\' || c == '"') { buf.append('\\'); } buf.append(c); } buf.append('"'); } else { buf.append(value); } }
while (index != text.length() && !MimeType.isSpecial(text.charAt(index))) { index += 1;
while (index != text.length() && !MimeType.isSpecial(text.charAt(index))) { index += 1;
while (index != text.length() && !MimeType.isSpecial(text.charAt(index))) { index += 1;