labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r689444 - in /labs/droids/trunk/src/core/java/org/apache/droids: DefaultWorker.java helper/factories/HandlerFactory.java protocol/HttpBase.java
Date Wed, 27 Aug 2008 10:53:02 GMT
Author: thorsten
Date: Wed Aug 27 03:53:02 2008
New Revision: 689444

URL: http://svn.apache.org/viewvc?rev=689444&view=rev
Log:
If we cannot connect to a server we will log this but will not hang/fail

Modified:
    labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java
    labs/droids/trunk/src/core/java/org/apache/droids/helper/factories/HandlerFactory.java
    labs/droids/trunk/src/core/java/org/apache/droids/protocol/HttpBase.java

Modified: labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java
URL: http://svn.apache.org/viewvc/labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java?rev=689444&r1=689443&r2=689444&view=diff
==============================================================================
--- labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java (original)
+++ labs/droids/trunk/src/core/java/org/apache/droids/DefaultWorker.java Wed Aug 27 03:53:02
2008
@@ -69,7 +69,9 @@
       if (getProtocol().isAllowed(url)) {
         String contentType = getProtocol().getContentType(url);
         Core.threadMessage("contentType " + contentType);
-        parser = parserFactory.getParser(contentType);
+        if (contentType!=null){
+          parser = parserFactory.getParser(contentType);
+        }
         // parse contains the outlinks and can be used later
         Parse parse = getParse();
         handle(parse);

Modified: labs/droids/trunk/src/core/java/org/apache/droids/helper/factories/HandlerFactory.java
URL: http://svn.apache.org/viewvc/labs/droids/trunk/src/core/java/org/apache/droids/helper/factories/HandlerFactory.java?rev=689444&r1=689443&r2=689444&view=diff
==============================================================================
--- labs/droids/trunk/src/core/java/org/apache/droids/helper/factories/HandlerFactory.java
(original)
+++ labs/droids/trunk/src/core/java/org/apache/droids/helper/factories/HandlerFactory.java
Wed Aug 27 03:53:02 2008
@@ -49,6 +49,9 @@
    */
   public boolean handle(InputStream stream, URL url, Parse parse) {
     byte[] streamCopy = null;
+    if(stream==null){
+      return false;
+    }
     try {
       streamCopy = Streams.streamCopy(stream);
     } catch (IOException e) {

Modified: labs/droids/trunk/src/core/java/org/apache/droids/protocol/HttpBase.java
URL: http://svn.apache.org/viewvc/labs/droids/trunk/src/core/java/org/apache/droids/protocol/HttpBase.java?rev=689444&r1=689443&r2=689444&view=diff
==============================================================================
--- labs/droids/trunk/src/core/java/org/apache/droids/protocol/HttpBase.java (original)
+++ labs/droids/trunk/src/core/java/org/apache/droids/protocol/HttpBase.java Wed Aug 27 03:53:02
2008
@@ -122,6 +122,8 @@
       return contentType;
     } catch (MalformedURLException e) {
       log.fatal(e);
+    } catch (NullPointerException e) {
+      log.fatal(e);
     } catch (IOException e) {
       log.fatal(e);
     } finally {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message