any23-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject git commit: ANY23-179 Improve Javadoc and throwing of IllegalArgumentException in Any23#createDocumentSource
Date Wed, 12 Mar 2014 21:58:57 GMT
Repository: any23
Updated Branches:
  refs/heads/master c6796330f -> c891e7487


ANY23-179 Improve Javadoc and throwing of IllegalArgumentException in Any23#createDocumentSource


Project: http://git-wip-us.apache.org/repos/asf/any23/repo
Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/c891e748
Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/c891e748
Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/c891e748

Branch: refs/heads/master
Commit: c891e7487f5aab4d28fa2c4ebbf4bc2e4888efce
Parents: c679633
Author: Lewis John McGibbney <lewismc@apache.org>
Authored: Wed Mar 12 21:58:33 2014 +0000
Committer: Lewis John McGibbney <lewismc@apache.org>
Committed: Wed Mar 12 21:58:33 2014 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/any23/Any23.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/any23/blob/c891e748/core/src/main/java/org/apache/any23/Any23.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/any23/Any23.java b/core/src/main/java/org/apache/any23/Any23.java
index 7c3d1e3..aed2373 100644
--- a/core/src/main/java/org/apache/any23/Any23.java
+++ b/core/src/main/java/org/apache/any23/Any23.java
@@ -23,7 +23,6 @@ import org.apache.any23.extractor.ExtractionException;
 import org.apache.any23.extractor.ExtractionParameters;
 import org.apache.any23.extractor.ExtractorFactory;
 import org.apache.any23.extractor.ExtractorGroup;
-import org.apache.any23.extractor.ExtractorRegistry;
 import org.apache.any23.extractor.ExtractorRegistryImpl;
 import org.apache.any23.extractor.SingleDocumentExtraction;
 import org.apache.any23.extractor.SingleDocumentExtractionReport;
@@ -247,7 +246,10 @@ public class Any23 {
     }
 
     /**
-     * Returns the most appropriate {@link DocumentSource} for the given<code>documentURI</code>.
+     * <p>Returns the most appropriate {@link DocumentSource} for the given<code>documentURI</code>.</p>
+     * <p><b>N.B.</b> <code>documentURI's</code> <i>should</i>
contain a protocol.
+     * E.g. <b>http:</b>, <b>https:</b>, <b>file:</b>
+     * </p>
      *
      * @param documentURI the document <i>URI</i>.
      * @return a new instance of DocumentSource.
@@ -263,7 +265,8 @@ public class Any23 {
             return new HTTPDocumentSource(getHTTPClient(), documentURI);
         }
         throw new IllegalArgumentException(
-                String.format("Unsupported protocol for document URI: '%s' .", documentURI)
+                String.format("Unsupported protocol for document URI: '%s' . "
+                    + "Check that document URI contains a protocol.", documentURI)
         );
     }
 


Mime
View raw message