knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject svn commit: r1724482 - in /knox: site/books/knox-0-4-0/likeised site/books/knox-0-5-0/likeised trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java
Date Wed, 13 Jan 2016 19:33:25 GMT
Author: kminder
Date: Wed Jan 13 19:33:25 2016
New Revision: 1724482

URL: http://svn.apache.org/viewvc?rev=1724482&view=rev
Log:
[KNOX-649] Deleting site or site/books output directory causing site generation to fail

Removed:
    knox/site/books/knox-0-4-0/likeised
    knox/site/books/knox-0-5-0/likeised
Modified:
    knox/trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java

Modified: knox/trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java
URL: http://svn.apache.org/viewvc/knox/trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java?rev=1724482&r1=1724481&r2=1724482&view=diff
==============================================================================
--- knox/trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java (original)
+++ knox/trunk/markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java Wed
Jan 13 19:33:25 2016
@@ -248,6 +248,11 @@ public class MarkBook {
   }
 
   private static void extractClassPathResourceToFile( String resource, File file ) throws
IOException {
+    File dir = file.getParentFile();
+    if( !dir.exists() && !dir.mkdirs() ) {
+      throw new IllegalStateException( String.format(
+          "Failed to create output directory %s for resource %s", dir.getAbsolutePath(),
resource  ) );
+    }
     FileOutputStream output = new FileOutputStream( file );
     IOUtils.copy( ClassLoader.getSystemResourceAsStream( resource ), output );
     output.close();



Mime
View raw message