Author: vsiveton
Date: Sun Aug  9 13:22:33 2009
New Revision: 802540

URL: http://svn.apache.org/viewvc?rev=802540&view=rev
Log:
MPDF-28: When specifying output dir, copy only the generated pdf

o copy only generated pdf using the documentModel.outputName

Modified:
    
maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Modified: 
maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=802540&r1=802539&r2=802540&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
 Sun Aug  9 13:22:33 2009
@@ -275,7 +275,13 @@
         {
             if ( !outputDirectory.getCanonicalPath().equals( 
workingDirectory.getCanonicalPath() ) )
             {
-                final List pdfs = FileUtils.getFiles( workingDirectory, 
"**/*.pdf", null );
+                String outputName = getDocumentModel( getDefaultLocale() 
).getOutputName();
+                if ( StringUtils.isNotEmpty( FileUtils.getExtension( 
outputName ) ) )
+                {
+                    outputName =
+                        outputName.substring( 0, outputName.indexOf( 
FileUtils.getExtension( outputName ) ) - 1 );
+                }
+                final List pdfs = FileUtils.getFiles( workingDirectory, "**/" 
+ outputName + ".pdf", null );
 
                 for ( final Iterator it = pdfs.iterator(); it.hasNext(); )
                 {


Reply via email to