spec = null;
}
private void loadServerNames()
{
XMLStreamReaderImpl xpp = new XMLStreamReaderImpl();
UTF8StreamReader reader = new UTF8StreamReader();
InputStream in = null;
try
{
File conf_file = new File(FService.SERVER_NAME_FILE);
if(!conf_file.exists()){
//old file position
conf_file = new File(FService.LEGACY_SERVER_NAME_FILE);
}
in = new FileInputStream(conf_file);
xpp.setInput(reader.setInput(in));
for(int e = xpp.getEventType(); e != XMLStreamConstants.END_DOCUMENT; e = xpp.next())
{
if(e == XMLStreamConstants.START_ELEMENT)
{
if(xpp.getLocalName().toString().equals("server"))
{
Integer id = new Integer(xpp.getAttributeValue(null, "id").toString());
String name = xpp.getAttributeValue(null, "name").toString();
_serverNames.put(id, name);
id = null;
name = null;
}
}
}
}
catch(FileNotFoundException e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
_log.warning("servername.xml could not be loaded: file not found");
}
catch(XMLStreamException xppe)
{
xppe.printStackTrace();
}
finally
{
try
{
xpp.close();
}
catch(XMLStreamException e)
{
e.printStackTrace();
}