showFatalError( "Unable to read settings.xml", e, showErrors );
return 1;
}
DefaultSecDispatcher dispatcher;
try
{
if ( commandLine.hasOption( CLIManager.ENCRYPT_MASTER_PASSWORD ) )
{
String passwd = commandLine.getOptionValue( CLIManager.ENCRYPT_MASTER_PASSWORD );
DefaultPlexusCipher cipher = new DefaultPlexusCipher();
System.out.println( cipher.encryptAndDecorate( passwd,
DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) );
return 0;
}
else if ( commandLine.hasOption( CLIManager.ENCRYPT_PASSWORD ) )
{
String passwd = commandLine.getOptionValue( CLIManager.ENCRYPT_PASSWORD );
dispatcher = (DefaultSecDispatcher) embedder.lookup( SecDispatcher.ROLE );
String configurationFile = dispatcher.getConfigurationFile();
if ( configurationFile.startsWith( "~" ) )
{
configurationFile = System.getProperty( "user.home" ) + configurationFile.substring( 1 );
}
String file = System.getProperty( DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION, configurationFile );