Package javolution.io

Examples of javolution.io.UTF8StreamReader


    InputStream in = null;
    try
    {
      in = new FileInputStream("servername.xml");
      XMLStreamReaderImpl xpp = new XMLStreamReaderImpl();
      xpp.setInput(new UTF8StreamReader().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"))
View Full Code Here


  }

  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();
      }
     
      try
      {
        reader.close();
      }
      catch(IOException e)
      {
        e.printStackTrace();
      }
View Full Code Here

    InputStream in = null;
    try
    {
      in = new FileInputStream("servername.xml");
      XMLStreamReaderImpl xpp = new XMLStreamReaderImpl();
      xpp.setInput(new UTF8StreamReader().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"))
View Full Code Here

TOP

Related Classes of javolution.io.UTF8StreamReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.