io.openlineage.client.DefaultConfigPathProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openlineage-java Show documentation
Show all versions of openlineage-java Show documentation
Java library for OpenLineage
/*
/* 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;
}
}