<commit_before>package edu.ucsf.lava.core.file;

import java.util.List;

import edu.ucsf.lava.core.file.exception.FileAccessException;
import edu.ucsf.lava.core.file.model.LavaFile;

/**
 * Defines delegated implementation details for a FileRepository.  The delegated 
 * details include organizational pattern (directory structure in the case of 
 * file system repositories) and methods for connecting and testing 
 * to repositories.  
 * @author jhesse
 *
 */
public interface FileRepositoryStrategy {
	
	/**
	 * Set the object reference back to the repository instance.
	 * @param repository
	 */
	public void setRepository(FileRepository repository);
	
	/**
	 * Gets the object reference to the repository instance.
	 * @return
	 */
	public FileRepository getRepository();
	

	/**
	 * Connect to repository.
	 * @return true if connection succeeds or already connected
	 * @throws FileAccessException
	 */
	public boolean connect() throws FileAccessException;
	
	/**
	 * Disconnect from repository
	 * @return
	 * @throws FileAccessException
	 */
	public boolean disconnect() throws FileAccessException;
	
	/**
	 * Whether there is an active connection to the repository
	 * @return
	 * @throws FileAccessException
	 */
	public boolean isConnected() throws FileAccessException;
	
	/**
	 * Test basic functionality of repository using testFile.  Implementation
	 * should perform whatever tests are necessary to satisfy that repository
	 * can perform supported methods (e.g. saveFile,deleteFile).
	 * @return
	 * @throws FileAccessException
	 */<commit_msg>not setting repository on strategy because direction of relationship is from repository to strategy and the same strategy could be used by multiple repositories, so do not tie a strategy to a given repository (note: this was not being set anyway, so got an error when tried to use it in default handlesFile method in LocalFileSystemRepositoryStrategy but decided did not need the repository for handlesFile implementations)<commit_after>package edu.ucsf.lava.core.file;

import java.util.List;

import edu.ucsf.lava.core.file.exception.FileAccessException;
import edu.ucsf.lava.core.file.model.LavaFile;

/**
 * Defines delegated implementation details for a FileRepository.  The delegated 
 * details include organizational pattern (directory structure in the case of 
 * file system repositories) and methods for connecting and testing 
 * to repositories.  
 * @author jhesse
 *
 */
public interface FileRepositoryStrategy {
	
	/**
	 * Connect to repository.
	 * @return true if connection succeeds or already connected
	 * @throws FileAccessException
	 */
	public boolean connect() throws FileAccessException;
	
	/**
	 * Disconnect from repository
	 * @return
	 * @throws FileAccessException
	 */
	public boolean disconnect() throws FileAccessException;
	
	/**
	 * Whether there is an active connection to the repository
	 * @return
	 * @throws FileAccessException
	 */
	public boolean isConnected() throws FileAccessException;
	
	/**
	 * Test basic functionality of repository using testFile.  Implementation
	 * should perform whatever tests are necessary to satisfy that repository
	 * can perform supported methods (e.g. saveFile,deleteFile).
	 * @return
	 * @throws FileAccessException
	 */
{'fraction_non_alphanumeric': 0.07081545064377683, 'fraction_numerical': 0.0, 'mean_word_length': 4.212460063897764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4669777', 'n_tokens_mistral': 854, 'n_tokens_neox': 767, 'n_words': 324}