Github user brosander commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/45#discussion_r85150335
  
    --- Diff: 
minifi-toolkit/minifi-toolkit-configuration/src/main/java/org/apache/nifi/minifi/toolkit/configuration/ConfigMain.java
 ---
    @@ -235,62 +252,127 @@ private static void 
addRemoteProcessGroupPortDTOs(Map<String, String> connectabl
             }
         }
     
    +    public int upgrade(String[] args) {
    +        if (args.length != 3) {
    +            printUgradeUsage();
    +            return ERR_INVALID_ARGS;
    +        }
    +
    +        ConfigSchema configSchema = null;
    +        try (InputStream inputStream = 
pathInputStreamFactory.create(args[1])) {
    +            try {
    +                configSchema = 
SchemaLoader.loadConfigSchemaFromYaml(inputStream);
    +            } catch (IOException|SchemaLoaderException e) {
    +                return handleErrorLoadingConfiguration(e, 
ConfigMain::printUgradeUsage);
    +            }
    +        } catch (FileNotFoundException e) {
    +            return handleErrorOpeningInput(args[1], 
ConfigMain::printUgradeUsage, e);
    +        } catch (IOException e) {
    +            handleErrorClosingInput(e);
    +        }
    +
    +        try (OutputStream fileOutputStream = 
pathOutputStreamFactory.create(args[2])) {
    +            try {
    +                SchemaSaver.saveConfigSchema(configSchema, 
fileOutputStream);
    +            } catch (IOException e) {
    +                return handleErrorSavingCofiguration(e);
    +            }
    +        } catch (FileNotFoundException e) {
    +            return handleErrorOpeningOutput(args[2], 
ConfigMain::printUgradeUsage, e);
    +        } catch (IOException e) {
    +            handleErrorClosingOutput(e);
    +        }
    +
    +        return SUCCESS;
    --- End diff --
    
    Good point, adding


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to