Return-Path: X-Original-To: apmail-any23-dev-archive@www.apache.org Delivered-To: apmail-any23-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCF9C10862 for ; Wed, 12 Mar 2014 22:00:57 +0000 (UTC) Received: (qmail 65459 invoked by uid 500); 12 Mar 2014 22:00:45 -0000 Delivered-To: apmail-any23-dev-archive@any23.apache.org Received: (qmail 65335 invoked by uid 500); 12 Mar 2014 22:00:44 -0000 Mailing-List: contact dev-help@any23.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@any23.apache.org Delivered-To: mailing list dev@any23.apache.org Received: (qmail 65308 invoked by uid 99); 12 Mar 2014 22:00:43 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2014 22:00:43 +0000 Date: Wed, 12 Mar 2014 22:00:43 +0000 (UTC) From: "Lewis John McGibbney (JIRA)" To: dev@any23.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (ANY23-179) Improve Javadoc and throwing of IllegalArgumentException in Any23#createDocumentSource MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ANY23-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lewis John McGibbney resolved ANY23-179. ---------------------------------------- Resolution: Fixed commit c891e7487f5aab4d28fa2c4ebbf4bc2e4888efce Author: Lewis John McGibbney Date: Wed Mar 12 21:58:33 2014 +0000 ANY23-179 Improve Javadoc and throwing of IllegalArgumentException in Any23#createDocumentSource > Improve Javadoc and throwing of IllegalArgumentException in Any23#createDocumentSource > -------------------------------------------------------------------------------------- > > Key: ANY23-179 > URL: https://issues.apache.org/jira/browse/ANY23-179 > Project: Apache Any23 > Issue Type: Improvement > Components: api > Affects Versions: 0.9.0 > Reporter: Lewis John McGibbney > Priority: Minor > Fix For: 1.0.0 > > Attachments: ANY23-179.patch > > > When one calls org.apache.any23.Any23.createDocumentSource(String documentURI) we only do the following simple checks > documentURI.toLowerCase().startsWith("http:" || 'file:' || 'https:'... > before picking the appropriate DocumentSource. > An improvement on this algorithm would be to add additional code to *attempt* to add the above protocol string's to the beginning of the documentURI after the above checks have been made. This way we carry out the same logical checks, in the same order but also make better attempts to find an appropriate DocumentSource before calling the IllegalArgumentException "Unsupported protocol for document URI: '%s' .", documentURI. > An example would be if someone were to pass in the following documentURI > '/Downloads/github/Scottish-Technical-Standards--Domestic-/html_domestic/domestic/section6' > In the above case this file happens to reside on the local file system however no 'file:' protocol has been added to the documentURI. -- This message was sent by Atlassian JIRA (v6.2#6252)