Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
In directory james.mmbase.org:/tmp/cvs-serv8695

Modified Files:
        NewsletterGenerator.java 
Log Message:
CMSC-1084, Newsletter: sending test email contains empty body,add error 
messages to print out  it uses the system live-path variable


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
See also: http://www.mmbase.org/jira/browse/CMSC-1084


Index: NewsletterGenerator.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/NewsletterGenerator.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- NewsletterGenerator.java    14 Oct 2008 11:22:44 -0000      1.13
+++ NewsletterGenerator.java    22 Oct 2008 08:51:25 -0000      1.14
@@ -4,6 +4,7 @@
 import java.io.Reader;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.util.regex.Pattern;
 
 import javax.mail.MessagingException;
 
@@ -25,11 +26,15 @@
       log.debug("generate newsletter from url:" + urlPath);
 
       String inputString = "";
+      String errorInfo="please check the system live-path variable, ";
       try {
 
          log.debug("Try to get content from URL:" + urlPath);
 
          URL url = new URL(urlPath);
+         if (!Pattern.matches("^(http  &brvbarftp  &brvbarfile)://.*",  
urlPath)) {
+            errorInfo += "the path does not start with http:// ";
+         }
          HttpURLConnection connection = (HttpURLConnection) 
url.openConnection();
 
          connection.setRequestMethod("GET");
@@ -57,7 +62,7 @@
 
          return (inputString);
       } catch (Exception e) {
-         log.error("Error when try to get content from" + urlPath, e);
+         log.error("Error when try to get content from" + urlPath+errorInfo, 
e);
       }
 
       return inputString;
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to