Package org.nextime.ion.backoffice.bean

Source Code of org.nextime.ion.backoffice.bean.Resources

package org.nextime.ion.backoffice.bean;

import java.io.File;
import java.io.FileInputStream;
import java.util.Vector;
import javax.servlet.http.HttpServlet;

public class Resources {

  private static ResourceXmlBean bean;
 
  public static ResourceXmlBean getResourceXmlBean(HttpServlet servlet, String id) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/resources.xml")) );
      bean = ResourceXmlBean.parse(fis);
      fis.close();
    }
    return bean.getResource(id);
  }
 
  public static Vector getResourceXmlBeans(HttpServlet servlet) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/resources.xml")) );
      bean = ResourceXmlBean.parse(fis);
      fis.close();
    }
    return bean.getItems();
  }

}
TOP

Related Classes of org.nextime.ion.backoffice.bean.Resources

TOP
Copyright © 2015 www.massapi.com. 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.