Package com.sematext.searchschemer.client

Source Code of com.sematext.searchschemer.client.SearchSchemer

package com.sematext.searchschemer.client;

import java.io.IOException;

import com.sematext.searchschemer.reader.IndexStructureReader;
import com.sematext.searchschemer.reader.IndexStructureReaderFactory;
import com.sematext.searchschemer.writer.IndexStructureWriter;
import com.sematext.searchschemer.writer.IndexStructureWriterFactory;

/**
* Main class.
*
* @author Sematext
*
*/
public final class SearchSchemer {
  /**
   * Private constructor - final class.
   */
  private SearchSchemer() {
  }

  /**
   * Main method.
   *
   * @param args
   *          command line arguments
   * @throws IOException
   *           throw when I/O error occurs
   */
  public static void main(String[] args) throws IOException {
    SearchSchemer schemer = new SearchSchemer();
    schemer.run(args);
  }

  /**
   * Starts schemer.
   *
   * @param args
   *          command line arguments
   * @throws IOException
   *           throw when I/O error occurs
   */
  private void run(String[] args) throws IOException {
    SearchSchemerArguments arguments = CommandLineReader.parse(args);
    if (arguments != null) {
      IndexStructureReader reader = IndexStructureReaderFactory.getReader(arguments.getInputType());
      IndexStructureWriter writer = IndexStructureWriterFactory.getWriter(arguments.getOutputType());
      writer.write(reader.read(arguments.getInputFileName()), arguments.getOutputFileName());
    }
  }
}
TOP

Related Classes of com.sematext.searchschemer.client.SearchSchemer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.