in nbm-maven-plugin/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java [613:645]
private File copyLauncher( File standaloneBuildDir, File builtInstallation )
throws IOException
{
File jnlpStarter
= new File( builtInstallation.getAbsolutePath() + File.separator + "harness" + File.separator + "jnlp"
+ File.separator + "jnlp-launcher.jar" );
// buffer so it isn't reading a byte at a time!
InputStream source = null;
FileOutputStream outstream = null;
try
{
if ( !jnlpStarter.exists() )
{
source = getClass().getClassLoader().getResourceAsStream(
"harness/jnlp/jnlp-launcher.jar" );
}
else
{
source = new FileInputStream( jnlpStarter );
}
File jnlpDestination = new File(
standaloneBuildDir.getAbsolutePath() + File.separator + "jnlp-launcher.jar" );
outstream = new FileOutputStream( jnlpDestination );
IOUtil.copy( source, outstream );
return jnlpDestination;
}
finally
{
IOUtil.close( source );
IOUtil.close( outstream );
}
}