{
String vendor = System.getProperty( "java.vendor", "<unknown>" );
if ( !vendor.toLowerCase().startsWith( "sun " ) && !vendor.toLowerCase().startsWith( "oracle " )){
throw( new PlatformManagerException(
MessageText.getString(
"platform.jvmopt.sunonly",
new String[]{ vendor })));
}
File[] option_files = getJVMOptionFiles();
if ( option_files.length != 2 ){
throw( new PlatformManagerException(
MessageText.getString( "platform.jvmopt.configerror" )));
}
File shared_options = option_files[0];
if ( shared_options.exists()){
try{
String s_options = FileUtil.readFileAsString( shared_options, -1 );
if ( s_options.contains( getJVMOptionRedirect() )){
File local_options = option_files[1];
return( local_options );
}else{
throw( new PlatformManagerException( MessageText.getString( "platform.jvmopt.nolink" )));
}
}catch( Throwable e ){
throw( new PlatformManagerException( MessageText.getString( "platform.jvmopt.accesserror", new String[]{ Debug.getNestedExceptionMessage(e) } )));
}
}else{
throw( new PlatformManagerException( MessageText.getString( "platform.jvmopt.nolinkfile" )));
}
}