package com.atlassian.bitbucket.mesh;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.List;

import static java.util.Objects.requireNonNull;

/**
 * Represents the application directories; the home directory and 0 or more data directories.
 */
public class ApplicationDirs {

    /**
     * The name of the default data store under the home directory, if no data directories are configured
     */
    public static final String DEFAULT_STORE = "store";

    private final List<Path> dataDirs;
    private final Path homeDir;
    private final Path sharedHomeDir;

    public ApplicationDirs(@Nonnull Path homeDir, @Nullable Path sharedHomeDir, @Nonnull List<Path> dataDirs) {
        this.dataDirs = requireNonNull(dataDirs, "dataDirs");
        this.homeDir = requireNonNull(homeDir, "homeDir");
        this.sharedHomeDir = sharedHomeDir;
    }

    @Nonnull
    public List<Path> getDataDirs() {
        return dataDirs;
    }

    @Nonnull
    public Path getHomeDir() {
        return homeDir;
    }

    @Nullable
    public Path getSharedHome() {
        return sharedHomeDir;
    }
}
