wu.kehua created RANGER-2563:
--------------------------------

             Summary: Optimize the code, keep the code style consistent and 
remove the invalid code in the embeddedwebserver project
                 Key: RANGER-2563
                 URL: https://issues.apache.org/jira/browse/RANGER-2563
             Project: Ranger
          Issue Type: Bug
          Components: Ranger
    Affects Versions: 2.1.0
            Reporter: wu.kehua
            Assignee: wu.kehua


1. Change from "System.err.println("err response: " + response);"
 to "logger.severe("Error response: " + response);"

2. RemoveĀ invalid code
{code:java}
private void uploadFileToZk(SolrZkClient zkClient, Path filePath,
                Path configsPath) throws FileNotFoundException {
        InputStream is = new FileInputStream(filePath.toString());
        try {
                if (zkClient.exists(configsPath.toString(), true)) {
                        zkClient.setData(configsPath.toString(),
                                        IOUtils.toByteArray(is), true);
                } else {
                        zkClient.create(configsPath.toString(),
                                        IOUtils.toByteArray(is), 
CreateMode.PERSISTENT, true);
                }
        } catch (Exception e) {
                throw new IllegalStateException(e);
        } finally {
                IOUtils.closeQuietly(is);
        }
}

private String getConfigFileName() { private String getConfigFileName() { 
        return SOLR_CONFIG_FILE; 
}
{code}
3. Change the parameter "CrendentialProviderPath" to "crendentialProviderPath"



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to