Package com.lbslocal.api.utils

Examples of com.lbslocal.api.utils.ConfigurationManager


    this.pathProject = pathProject;
    this.pathToWrite = pathToWrite;
  }

  void generateAll() {
    ConfigurationManager cm = ConfigurationManager.getInstance();

    String[] apis = cm.getAppSettings("apis").toString().split(Pattern.quote("|"));
    File fileDir = new File(pathToWrite);
    if (!fileDir.exists())
      fileDir.mkdirs();

    String dados;
    File file;
    for (int i = 0; i < apis.length; i++) {
      try {
        dados = ToFileString(pathProject, cm.getAppSettings(apis[i]).split(Pattern.quote("|")));

        file = new File(pathToWrite + File.separator + apis[i] + "_debug.js");
        if (file.exists())
          file.delete();
        file = new File(pathToWrite + File.separator + apis[i] + ".js");
View Full Code Here


  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    String physicalPath = getServletContext().getRealPath("") + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + "com"
        + File.separator + "lbslocal" + File.separator + "api" + File.separator + "scripts";

    ConfigurationManager cm = ConfigurationManager.getInstance();
    com.lbslocal.master.common.ConfigurationManager cmMaster = com.lbslocal.master.common.ConfigurationManager.getInstance();

    ControlJavaScriptAPI memoryAPI = new ControlJavaScriptAPI(physicalPath, cmMaster.getAppSettings("PATH_FILE_API"));

    String AcceptEncoding, versionApi, engine, api, debug;
    boolean useGZip = true;

    engine = request.getParameter("engine") == null ? "" : request.getParameter("engine");
    versionApi = request.getParameter("v") == null ? "3" : request.getParameter("v");
    debug = request.getParameter("debug") == null ? "" : request.getParameter("debug");
    ServletOutputStream out = null;
    File file;
    RandomAccessFile raf = null;
    try {
      response.setContentType("application/x-javascript");

      AcceptEncoding = request.getHeader("Accept-Encoding");

      // *** Start by checking whether GZip is supported by client
      if (AcceptEncoding == null || AcceptEncoding.toLowerCase().indexOf("gzip") == -1)
        useGZip = false;

      api = "v" + versionApi + engine.toLowerCase();
     

      // é uma chamada de debug?
      if ("true".equals(cm.getAppSettings("debugJS")) || debug.equals("true")) {
        response.setHeader("Content-Encoding", "UTF-8");
        file = memoryAPI.getAPI(api, ControlJavaScriptAPI.Debug);
      } else {
        // é possivel usar o gzip?
        if (useGZip) {
View Full Code Here

TOP

Related Classes of com.lbslocal.api.utils.ConfigurationManager

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.