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

rs.data.file.util.IFilenameStrategy Maven / Gradle / Ivy

The newest version!
/*
 * This file is part of RS Library (Data File Library).
 *
 *  RS Library is free software: you can redistribute it 
 *  and/or modify it under the terms of version 3 of the GNU 
 *  Lesser General Public  License as published by the Free Software 
 *  Foundation.
 *  
 *  RS Library 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.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public 
 *  License along with RS Library.  If not, see 
 *  .
 */
package rs.data.file.util;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collection;

/**
 * Interface that defines a filename strategy for deriving filenames from keys.
 * @param  type of ID this strategy converts to file names
 * @author ralph
 *
 */
public interface IFilenameStrategy {

	/** The default data directory */
	public static final String DEFAULT_DATA_DIR = "data";	
	/** The default suffix */
	public static final String DEFAULT_DATA_SUFFIX = ".data";

	/**
	 * Compute the filename from the key.
	 * @param key key
	 * @return filename for key
	 * @throws IOException when the file cannot be read
	 */
	public File getFile(K key) throws IOException;
	
	/**
	 * Returns all existing files that the strategy knows about.
	 * @return all existing files
	 */
	public Collection getFiles();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy