public static URIParsedResult parse(Result result) { String rawText = result.getText(); // We specifically handle the odd "URL" scheme here for simplicity if (rawText != null && rawText.startsWith("URL:")) { rawText = rawText.substring(4); } if (!isBasicallyValidURI(rawText)) { return null; } return new URIParsedResult(rawText, null); }
} else if ((result = URLTOResultParser.parse(theResult)) != null) { return result; } else if ((result = URIResultParser.parse(theResult)) != null) { return result; } else if ((result = ISBNResultParser.parse(theResult)) != null) {
public static URIParsedResult parse(Result result) { String rawText = result.getText(); if (rawText == null || !rawText.startsWith("MEBKM:")) { return null; } String title = matchSingleDoCoMoPrefixedField("TITLE:", rawText, true); String[] rawUri = matchDoCoMoPrefixedField("URL:", rawText, true); if (rawUri == null) { return null; } String uri = rawUri[0]; if (!URIResultParser.isBasicallyValidURI(uri)) { return null; } return new URIParsedResult(uri, title); }