Interface IRepository
The IRepository interface that all Repositories have to implement. Repositories are used for I/O operations, so that we dont have to spread those accross the project.
Namespace:
Assembly: .dll
Syntax
public interface IRepository
Methods
combinePath(String path, String[] more)
Combines path strings to one string
Declaration
public abstract String combinePath(String path, String[] more)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | path | The base path |
java.lang.String[] | more | The paths to add |
Returns
Type | Description |
---|---|
java.lang.String | The combined path |
createMissingDirectories(String filePath)
Creates missing directorie for a given file path
Declaration
public abstract boolean createMissingDirectories(String filePath)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | filePath | The file path |
Returns
Type | Description |
---|---|
boolean | True if directories were created |
deleteFile(String filePath)
Deletes a file at a given path
Declaration
public abstract boolean deleteFile(String filePath)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | filePath | The path of the file to delete |
Returns
Type | Description |
---|---|
boolean | True if deleted |
deleteFolder(File folder)
Recursively deletes a folder and all its contents
Declaration
public abstract boolean deleteFolder(File folder)
Parameters
Type | Name | Description |
---|---|---|
java.io.File | folder | The folder to delete |
Returns
Type | Description |
---|---|
boolean | True if everything was deleted |
loadFile(String filePath)
Reads in a file at a given path
Declaration
public abstract File loadFile(String filePath)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | filePath | The path to the file |
Returns
Type | Description |
---|---|
java.io.File | The read in file |
readFileContents(String filePath)
Reads the contents of a file at a given path
Declaration
public abstract String readFileContents(String filePath)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | filePath | The path to the file |
Returns
Type | Description |
---|---|
java.lang.String | The contents of the file or empty string if unsuccessful |
renameFile(String filePath, String newFilePath)
Renames a file at a given path to
Declaration
public abstract boolean renameFile(String filePath, String newFilePath)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | filePath | The path to the file to rename |
java.lang.String | newFilePath | The new path for the file |
Returns
Type | Description |
---|---|
boolean | True if file was renamed succesfully |
writeToFile(String filePath, String content)
Writes string content to a file at a given path
Declaration
public abstract boolean writeToFile(String filePath, String content)
Parameters
Type | Name | Description |
---|---|---|
java.lang.String | filePath | The path to the file |
java.lang.String | content | The content of the file |
Returns
Type | Description |
---|---|
boolean | True if file was successfully written |