001/*
002 * Copyright 2013 Atteo.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.atteo.moonshine.directories;
017
018import java.nio.file.Path;
019import java.util.Properties;
020
021public interface FileAccessor {
022
023    /**
024     * Returns the first existing config file found with given name.
025     * @return path to the config file, or null if not exist
026     */
027    Path getConfigFile(String fileName);
028
029    /**
030     * Return all existing config files with given name.
031     */
032    Iterable<Path> getConfigFiles(String fileName);
033
034    /**
035     * Return the path where config file with given name should exist.
036     * The file may or may not exist.
037     */
038    Path getWritebleConfigFile(String fileName);
039
040    /**
041     * Returns the first existing data file found with given name.
042     * @return path to the data file, or null if not exist
043     */
044    Path getDataFile(String fileName);
045
046    /**
047     * Returns all existing data files with given name.
048     */
049    Iterable<Path> getDataFiles(String fileName);
050
051    /**
052     * Returns the path where data file with given name should stored.
053     * The file may or may not exist.
054     */
055    Path getWriteableDataFile(String fileName);
056
057    /**
058     * Returns the path where cache file with given name should stored.
059     * The file may or may not exist.
060     */
061    Path getWriteableCacheFile(String fileName);
062
063    /**
064     * Returns the path where log files with given name should be stored.
065     * The file may or may not exist.
066     */
067    Path getWriteableLogfile(String fileName);
068
069    /**
070     * Returns filtering properties.
071     */
072    Properties getProperties();
073}