Package org.eclipse.orion.server.git.objects

Examples of org.eclipse.orion.server.git.objects.ConfigOption.toJSON()


      Repository db = null;
      try {
        db = FileRepositoryBuilder.create(gitDir);
        URI cloneLocation = BaseToCloneConverter.getCloneLocation(baseLocation, BaseToCloneConverter.CONFIG);
        ConfigOption configOption = new ConfigOption(cloneLocation, db);
        OrionServlet.writeJSONResponse(request, response, configOption.toJSON(/* all */), JsonURIUnqualificationStrategy.ALL_NO_GIT);
        return true;
      } finally {
        if (db != null) {
          db.close();
        }
View Full Code Here


        db = FileRepositoryBuilder.create(gitDir);
        ConfigOption configOption = new ConfigOption(cloneLocation, db, p.segment(0));
        if (!configOption.exists())
          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND,
              "There is no config entry with key provided", null));
        OrionServlet.writeJSONResponse(request, response, configOption.toJSON(), JsonURIUnqualificationStrategy.ALL_NO_GIT);
        return true;
      } catch (IllegalArgumentException e) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), e));
      } finally {
        if (db != null) {
View Full Code Here

          valList.addAll(Arrays.asList(val));
        }
        valList.add(value);
        save(configOption, valList);

        JSONObject result = configOption.toJSON();
        OrionServlet.writeJSONResponse(request, response, result, JsonURIUnqualificationStrategy.ALL_NO_GIT);
        response.setHeader(ProtocolConstants.HEADER_LOCATION, result.getString(ProtocolConstants.KEY_LOCATION));
        response.setStatus(HttpServletResponse.SC_CREATED);
        return true;
      } catch (IllegalArgumentException e) {
View Full Code Here

          valList.add(value.getString(i));
        }

        save(configOption, valList);

        JSONObject result = configOption.toJSON();
        OrionServlet.writeJSONResponse(request, response, result);
        response.setHeader(ProtocolConstants.HEADER_LOCATION, result.getString(ProtocolConstants.KEY_LOCATION));
        return true;
      } catch (IllegalArgumentException e) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), e));
View Full Code Here

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.