You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-dev@incubator.apache.org by Brett Porter <br...@apache.org> on 2010/11/21 23:09:20 UTC
Re: svn commit: r1036796 - in /incubator/npanday/trunk/plugins/maven-vsinstaller-plugin/src: main/java/npanday/plugin/vsinstaller/VsInstallerMojo.java test/groovy/npanday/plugin/vsinstaller/VsInstallerMojoTest.groovy
On 19/11/2010, at 9:47 PM, apadilla@apache.org wrote:
> File srcFolder = new File( src );
> - File destFolder = new File( dest );
> + File destFolder = new File( installationLocation );
>
> - new File( dest ).mkdirs();
> + new File( installationLocation ).mkdirs();
...
> + private void getInstallationLocation()
> + {
> + if ( installationLocation == null || installationLocation.length() == 0 )
> + {
> + String programFilesPath = System.getenv( "PROGRAMFILES" );
> +
> + if ( programFilesPath == null || programFilesPath.length() == 0 )
> + {
> + programFilesPath = System.getProperty( "user.dir" );
> + }
> + installationLocation = programFilesPath + File.separator + "NPanday";
> + }
> +
> + installationLocation = installationLocation + File.separator + "bin";
> + }
I'd suggest making installationLocation a File type to start with - Maven will deal with it correctly. You should avoid pasting together paths - see this comment: https://issues.apache.org/jira/browse/NPANDAY-345?focusedCommentId=12932941&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12932941
That would also avoid needing to convert it twice in the earlier example.
- Brett
--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/