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

io.openlineage.client.DefaultConfigPathProvider Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
/*
/* Copyright 2018-2023 contributors to the OpenLineage project
/* SPDX-License-Identifier: Apache-2.0
*/

package io.openlineage.client;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

public class DefaultConfigPathProvider implements ConfigPathProvider {
  private static final String OPENLINEAGE_YML = "openlineage.yml";

  @Override
  public List getPaths() {
    List paths = new ArrayList<>();

    if (System.getenv("OPENLINEAGE_CONFIG") != null) {
      paths.add(Paths.get(System.getenv("OPENLINEAGE_CONFIG")));
    }

    if (System.getProperty("user.dir") != null) {
      paths.add(Paths.get(System.getProperty("user.dir") + File.separatorChar + OPENLINEAGE_YML));
    }
    if (System.getProperty("user.home") != null) {
      paths.add(
          Paths.get(
              System.getProperty("user.home")
                  + File.separatorChar
                  + ".openlineage"
                  + File.separatorChar
                  + OPENLINEAGE_YML));
    }
    return paths;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy