maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r385433 - /maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Date Mon, 13 Mar 2006 05:44:38 GMT
Author: brett
Date: Sun Mar 12 21:44:35 2006
New Revision: 385433

URL: http://svn.apache.org/viewcvs?rev=385433&view=rev
Log:
[MSITE-80] move resources to correct location

Modified:
    maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java

Modified: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=385433&r1=385432&r2=385433&view=diff
==============================================================================
--- maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
(original)
+++ maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Sun Mar 12 21:44:35 2006
@@ -95,7 +95,7 @@
      */
     private I18N i18n;
 
-    private static final String RESOURCE_DIR = "org/apache/maven/plugins/site";
+    private static final String RESOURCE_DIR = "org/apache/maven/doxia/siterenderer/resources";
 
     private static final String DEFAULT_TEMPLATE = RESOURCE_DIR + "/default-site.vm";
 
@@ -411,42 +411,45 @@
     public void copyResources( File outputDir, SiteRenderingContext siteContext )
         throws IOException
     {
-        // TODO: plexus-archiver, if it could do the excludes
-        ZipFile file = new ZipFile( siteContext.getSkinJarFile() );
-        try
+        if ( siteContext.getSkinJarFile() != null )
         {
-            for ( Enumeration e = file.entries(); e.hasMoreElements(); )
+            // TODO: plexus-archiver, if it could do the excludes
+            ZipFile file = new ZipFile( siteContext.getSkinJarFile() );
+            try
             {
-                ZipEntry entry = (ZipEntry) e.nextElement();
-
-                if ( !entry.getName().startsWith( "META-INF/" ) )
+                for ( Enumeration e = file.entries(); e.hasMoreElements(); )
                 {
-                    File destFile = new File( outputDir, entry.getName() );
-                    if ( !entry.isDirectory() )
+                    ZipEntry entry = (ZipEntry) e.nextElement();
+
+                    if ( !entry.getName().startsWith( "META-INF/" ) )
                     {
-                        destFile.getParentFile().mkdirs();
+                        File destFile = new File( outputDir, entry.getName() );
+                        if ( !entry.isDirectory() )
+                        {
+                            destFile.getParentFile().mkdirs();
 
-                        FileOutputStream fos = new FileOutputStream( destFile );
+                            FileOutputStream fos = new FileOutputStream( destFile );
 
-                        try
-                        {
-                            IOUtil.copy( file.getInputStream( entry ), fos );
+                            try
+                            {
+                                IOUtil.copy( file.getInputStream( entry ), fos );
+                            }
+                            finally
+                            {
+                                IOUtil.close( fos );
+                            }
                         }
-                        finally
+                        else
                         {
-                            IOUtil.close( fos );
+                            destFile.mkdirs();
                         }
                     }
-                    else
-                    {
-                        destFile.mkdirs();
-                    }
                 }
             }
-        }
-        finally
-        {
-            file.close();
+            finally
+            {
+                file.close();
+            }
         }
 
         if ( siteContext.isUsingDefaultTemplate() )



Mime
View raw message