Package dd2480.group4.storage
Interface RepositoryHandler
- All Known Implementing Classes:
Repository
public interface RepositoryHandler
The interface for handling repositories.
-
Method Summary
Modifier and Type Method Description void
cloneGit(java.nio.file.Path path, java.lang.String repo)
Clones a repository to the given path.void
cloneGit(java.nio.file.Path path, java.lang.String repo, java.lang.String hashId)
Clones a repository to the given path.java.nio.file.Path
createDirectory()
Creates a temporary directory and returns the path to it.void
deleteDirectory(java.nio.file.Path path)
Deletes the directory at the given path.
-
Method Details
-
createDirectory
java.nio.file.Path createDirectory() throws java.io.IOExceptionCreates a temporary directory and returns the path to it.- Returns:
- the path to the directory
- Throws:
java.io.IOException
- if it fails to create the repository
-
cloneGit
void cloneGit(java.nio.file.Path path, java.lang.String repo) throws java.io.IOException, java.lang.InterruptedExceptionClones a repository to the given path.- Parameters:
path
- the location where the repositories is cloned to.repo
- the http-address to the repo to be cloned.- Throws:
java.io.IOException
java.lang.InterruptedException
-
cloneGit
void cloneGit(java.nio.file.Path path, java.lang.String repo, java.lang.String hashId) throws java.io.IOException, java.lang.InterruptedExceptionClones a repository to the given path.- Parameters:
path
- the location where the repositories is cloned to.repo
- the http-address to the repo to be cloned.hashId
- the commit hash to checkout- Throws:
java.io.IOException
java.lang.InterruptedException
-
deleteDirectory
void deleteDirectory(java.nio.file.Path path) throws java.io.IOExceptionDeletes the directory at the given path.- Parameters:
path
- the path to the directory which is to be deleted.- Throws:
java.io.IOException
-