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

br.com.jhonsapp.file.manager.contract.FileManager Maven / Gradle / Ivy

Go to download

File Manager is an open source project created by Jhonys Camacho and Jhonathan Camacho to facilitate the file management in local and remote repositories.

The newest version!
package br.com.jhonsapp.file.manager.contract;

import java.io.Serializable;

import br.com.jhonsapp.file.manager.file.FileEntity;

/**
 * Interface responsible for manipulating files in a specific directory.
 * 
 * @author Jhonathan Camacho
 *
 */
public interface FileManager extends Serializable {

	/**
	 * Inserts or updates a file in the directory.
	 * 
	 * @param entity
	 *            representation of the file to be inserted or updated.
	 * 
	 * @return true if the insert or update operation was successful and false
	 *         otherwise.
	 */
	public boolean insert(FileEntity entity);

	/**
	 * Remove a file in the directory.
	 * 
	 * @param fileName
	 *            file name.
	 * 
	 * @return true if the removal was successful and false otherwise.
	 */
	public boolean remove(String fileName);

	/**
	 * Gets a file by the file name.
	 * 
	 * @param fileName
	 *            file name.
	 * 
	 * @return if a file exists it will be returned otherwise it returns null.
	 */
	public FileEntity getFile(String fileName);

	/**
	 * Checks whether the file exists in the directory.
	 * 
	 * @param fileName
	 *            file name.
	 * 
	 * @return if the file exists it returns true otherwise false.
	 */
	public boolean hasFile(String fileName);

	/**
	 * Gets the path of the repository.
	 * 
	 * @return the repository path.
	 */
	public String getRepositoryPath();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy