All Downloads are FREE. Search and download functionalities are using the official Maven repository.

schemacrawler.Version Maven / Gradle / Ivy

Go to download

SchemaCrawler is an open-source Java API that makes working with database metadata as easy as working with plain old Java objects. SchemaCrawler is also a database schema discovery and comprehension, and schema documentation tool. You can search for database schema objects using regular expressions, and output the schema and data in a readable text format. The output is designed to be diff-ed against other database schemas.

There is a newer version: 16.24.2
Show newest version
/*
========================================================================
SchemaCrawler
http://www.schemacrawler.com
Copyright (c) 2000-2024, Sualeh Fatehi .
All rights reserved.
------------------------------------------------------------------------

SchemaCrawler is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SchemaCrawler and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0, GNU General Public License
v3 or GNU Lesser General Public License v3.

You may elect to redistribute this code under any of these licenses.

The Eclipse Public License is available at:
http://www.eclipse.org/legal/epl-v10.html

The GNU General Public License v3 and the GNU Lesser General Public
License v3 are available at:
http://www.gnu.org/licenses/

========================================================================
*/

package schemacrawler;

import static java.lang.System.lineSeparator;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.stream.Collectors.toList;
import java.io.BufferedReader;
import java.util.List;
import schemacrawler.schemacrawler.exceptions.InternalRuntimeException;
import us.fatehi.utility.ioresource.ClasspathInputResource;
import us.fatehi.utility.property.BaseProductVersion;

/**
 * Version information for this product. Has methods to obtain information about the product, as
 * well as a main method, so it can be called from the command-line.
 */
public final class Version extends BaseProductVersion {

  private static final long serialVersionUID = 1143606778430634288L;

  private static final String ABOUT;
  private static final Version VERSION;

  static {
    try (final BufferedReader reader =
        new BufferedReader(
            new ClasspathInputResource("/help/SchemaCrawler.txt").openNewInputReader(UTF_8))) {

      final List lines = reader.lines().collect(toList());
      lines.add("");

      final String productVersion = lines.get(0).split(" ")[1];
      VERSION = new Version("SchemaCrawler", productVersion);
      ABOUT = String.join(lineSeparator(), lines);

    } catch (final Exception e) {
      throw new InternalRuntimeException("Could not read internal information");
    }
  }

  /**
   * Information about this product.
   *
   * @return Information about this product.
   */
  public static String about() {
    return ABOUT;
  }

  /**
   * Main routine. Prints information about this product.
   *
   * @param args Arguments to the main routine - they are ignored.
   */
  public static void main(final String[] args) {
    System.out.println(ABOUT);
  }

  public static Version version() {
    return VERSION;
  }

  private Version(final String productName, final String productVersion) {
    super(productName, productVersion);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy