Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2563

Optimize the code, keep the code style consistent and remove the invalid code in the embeddedwebserver project

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.0
    • None
    • Ranger
    • Patch

    Description

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

      2. RemoveĀ invalid code

      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; 
      }
      

      3. Change the parameter "CrendentialProviderPath" to "crendentialProviderPath"

      Attachments

        Activity

          People

            wkh8011 wu.kehua
            wkh8011 wu.kehua
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: