WangYuan created RANGER-1877:
--------------------------------

             Summary: The ranger policies json file should be formatted when 
exported  at ranger service manager. 
                 Key: RANGER-1877
                 URL: https://issues.apache.org/jira/browse/RANGER-1877
             Project: Ranger
          Issue Type: Bug
          Components: admin, Ranger
    Affects Versions: master
            Reporter: WangYuan
            Assignee: WangYuan
            Priority: Minor


The ranger policies json file should be formatted when exported  at ranger 
service manager. 
I found  it's difficult to edit the unformatted json file.

{code:title=ServiceDBStore.java|borderStyle=solid}
private void writeJson(List<RangerPolicy> policies, String jsonFileName,
                        HttpServletResponse response) throws JSONException, 
IOException {
                ... ...
                //Gson gson = new Gson();      //shoud be replaced:
                Gson gson = new GsonBuilder().setPrettyPrinting().create();
                
                String json = gson.toJson(rangerExportPolicyList, 
RangerExportPolicyList.class);
                ... ...
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to