You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2007/08/27 13:58:32 UTC

svn commit: r570084 - /maven/sandbox/trunk/doxia/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java

Author: ltheussl
Date: Mon Aug 27 04:58:31 2007
New Revision: 570084

URL: http://svn.apache.org/viewvc?rev=570084&view=rev
Log:
Don't throw NPE when no output specified, just skip storing the results.

Modified:
    maven/sandbox/trunk/doxia/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java

Modified: maven/sandbox/trunk/doxia/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java?rev=570084&r1=570083&r2=570084&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java (original)
+++ maven/sandbox/trunk/doxia/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkCheck.java Mon Aug 27 04:58:31 2007
@@ -143,7 +143,7 @@
     /**
      * Sets the name of the cacheFile.
      *
-     * @param cacheFile The cacheFile to set
+     * @param cacheFile The cacheFile to set. Set this to null to ignore storing the cache.
      */
     public void setCache( String cacheFile )
     {
@@ -212,7 +212,6 @@
         this.lvm = validator;
     }
 
-
     /**
      * Returns the LinkValidatorManager.
      * If this hasn't been set before with {@link #setLinkValidatorManager(LinkValidatorManager)}
@@ -258,6 +257,7 @@
 
     /**
      * Set the output file for the results.
+     * If this is null, no output will be written.
      *
      * @param file the output file.
      */
@@ -267,6 +267,16 @@
     }
 
     /**
+     * Returns the output file.
+     *
+     * @return File
+     */
+    public File getOutput()
+    {
+        return this.output;
+    }
+
+    /**
      * Returns the outputEncoding.
      *
      * @return String
@@ -356,7 +366,7 @@
     {
         if ( this.output == null )
         {
-            throw new NullPointerException( "output must be set" );
+            LOG.warn( "No output file specified! Results will not be written!" );
         }
 
         displayMemoryConsumption();
@@ -461,6 +471,11 @@
      */
     private void createDocument() throws FileNotFoundException
     {
+        if ( this.output == null )
+        {
+            return;
+        }
+
         File dir = this.output.getParentFile();
 
         if ( dir != null )