use of org.apache.jackrabbit.oak.upgrade.cli.parser.CliArgumentException in project jackrabbit-oak by apache.
the class CopyBinariesTest method prepare.
@Before
@Override
public void prepare() throws Exception {
NodeStore source = getSourceContainer().open();
try {
initContent(source);
} finally {
getSourceContainer().close();
}
String[] args = getArgs();
log.info("oak2oak {}", Joiner.on(' ').join(args));
try {
MigrationCliArguments cliArgs = new MigrationCliArguments(OptionParserFactory.create().parse(args));
MigrationOptions options = new MigrationOptions(cliArgs);
StoreArguments stores = new StoreArguments(options, cliArgs.getArguments());
DatastoreArguments datastores = new DatastoreArguments(options, stores, stores.srcUsesEmbeddedDatastore());
OakUpgrade.migrate(options, stores, datastores);
assertEquals(blobMigrationCase, datastores.getBlobMigrationCase());
} catch (CliArgumentException e) {
if (blobMigrationCase == DatastoreArguments.BlobMigrationCase.UNSUPPORTED) {
return;
} else {
throw e;
}
}
createSession();
}
use of org.apache.jackrabbit.oak.upgrade.cli.parser.CliArgumentException in project jackrabbit-oak by apache.
the class OakUpgrade method main.
public static void main(String... args) throws IOException {
OptionSet options = OptionParserFactory.create().parse(args);
try {
MigrationCliArguments cliArguments = new MigrationCliArguments(options);
if (cliArguments.hasOption(OptionParserFactory.HELP) || cliArguments.getArguments().isEmpty()) {
CliUtils.displayUsage();
return;
}
migrate(cliArguments);
} catch (CliArgumentException e) {
if (e.getMessage() != null) {
System.err.println(e.getMessage());
}
System.exit(e.getExitCode());
}
}
Aggregations