jvanzyl 2004/04/07 17:50:33 Modified: maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc XdocPlugin.java maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/render DefaultXdocRenderer.java Log: Revision Changes Path 1.5 +58 -3 maven-components/maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/XdocPlugin.java Index: XdocPlugin.java =================================================================== RCS file: /home/cvs/maven-components/maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/XdocPlugin.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- XdocPlugin.java 7 Apr 2004 17:37:39 -0000 1.4 +++ XdocPlugin.java 8 Apr 2004 00:50:33 -0000 1.5 @@ -11,6 +11,8 @@ import java.io.File; import java.io.FileWriter; import java.io.InputStream; +import java.io.OutputStream; +import java.io.FileOutputStream; import java.util.Iterator; import java.util.List; @@ -69,7 +71,52 @@ FileUtils.copyDirectory( new File( xdocDirectory, "images" ), new File( outputDirectory, "images" ) ); } - + + private void copy( InputStream input, OutputStream output ) + throws Exception + { + byte[] buffer = new byte[1024]; + + int n; + + while ( -1 != ( n = input.read( buffer ) ) ) + { + output.write( buffer, 0, n ); + } + + shutdownStream( input ); + + shutdownStream( output ); + } + + protected void shutdownStream( InputStream input ) + { + if ( input != null ) + { + try + { + input.close(); + } + catch ( Exception e ) + { + } + } + } + + protected void shutdownStream( OutputStream output ) + { + if ( output != null ) + { + try + { + output.close(); + } + catch ( Exception e ) + { + } + } + } + private void copyStyle( String outputDirectory ) throws Exception { @@ -81,7 +128,11 @@ { File f = new File( outputDirectory, css[i] ); - IOUtil.copy( getStream( css[i]), new FileWriter( f ) ); + FileOutputStream w = new FileOutputStream( f ); + + InputStream is = getStream( css[i]); + + copy( is, w ); } } @@ -96,7 +147,11 @@ { File f = new File( outputDirectory, image[i] ); - IOUtil.copy( getStream( image[i]), new FileWriter( f ) ); + FileOutputStream w = new FileOutputStream( f ); + + InputStream is = getStream( image[i]); + + copy( is, w ); } } 1.5 +12 -1 maven-components/maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/render/DefaultXdocRenderer.java Index: DefaultXdocRenderer.java =================================================================== RCS file: /home/cvs/maven-components/maven-plugins/maven-xdoc-plugin/src/main/java/org/apache/maven/xdoc/render/DefaultXdocRenderer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DefaultXdocRenderer.java 7 Apr 2004 19:08:54 -0000 1.4 +++ DefaultXdocRenderer.java 8 Apr 2004 00:50:33 -0000 1.5 @@ -115,6 +115,17 @@ this.outputDirectory = outputDirectory; } + + // Elements we need out of the POM + // + // #project.getName() + // #project.getUrl() + // #project.getLogo() + // #project.getInceptionYear() + // #project.getOrganization().getName() + // #project.getOrganization().getUrl() + // #project.getOrganization().getLogo() + } public void render( String xdoc, String basedir, MavenProject project, String outputDirectory )
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]