Package org.nextime.ion.backoffice.bean

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

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 SectionTypes {

  private static TypeBean bean;
 
  public static TypeBean getSectionBean(HttpServlet servlet, String template) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/templates.xml")) );
      bean = TypeBean.parse(fis);
      fis.close();
    }
    return bean.getBean(template);
  }
 
  public static Vector getSectionsBeans(HttpServlet servlet) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/templates.xml")) );
      bean = TypeBean.parse(fis);
      fis.close();
    }
    return bean.getItems();
  }

}
TOP

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

TOP
Copyright © 2018 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.