Remove dead code

This commit is contained in:
René Pfeuffer
2018-11-23 13:16:18 +01:00
parent 8b8240319b
commit aa596af880
7 changed files with 11 additions and 38 deletions

View File

@@ -86,7 +86,7 @@ public abstract class AbstractSimpleRepositoryHandler<C extends RepositoryConfig
@Override
public Repository create(Repository repository) {
File directory = repositoryLocationResolver.getNativeDirectory(repository);
File directory = initialRepositoryLocationResolver.getDefaultNativeDirectory(repository);
if (directory != null && directory.exists()) {
throw new AlreadyExistsException(repository);
}
@@ -161,11 +161,6 @@ public abstract class AbstractSimpleRepositoryHandler<C extends RepositoryConfig
return directory;
}
@Override
public File getInitialBaseDirectory() {
return initialRepositoryLocationResolver.getBaseDirectory();
}
@Override
public String getVersionInformation() {
return DEFAULT_VERSION_INFORMATION;

View File

@@ -30,15 +30,16 @@ public class InitialRepositoryLocationResolver {
this.context = context;
}
File getBaseDirectory() {
return new File(context.getBaseDirectory(), DEFAULT_REPOSITORY_PATH);
}
File getDefaultDirectory(Repository repository) {
String initialRepoFolder = getRelativeRepositoryPath(repository);
return new File(context.getBaseDirectory(), initialRepoFolder);
}
File getDefaultNativeDirectory(Repository repository) {
String initialRepoFolder = getRelativeRepositoryPath(repository);
return new File(context.getBaseDirectory(), initialRepoFolder + "/data");
}
public String getRelativeRepositoryPath(Repository repository) {
return DEFAULT_REPOSITORY_PATH + File.separator + repository.getId();
}

View File

@@ -11,10 +11,7 @@ import java.nio.file.Path;
public interface PathBasedRepositoryDAO extends RepositoryDAO {
/**
* get the current path of the repository or create it
*
* @param repository
* @return the current path of the repository
* Get the current path of the repository. This works for existing repositories only, not for repositories that should be created.
*/
Path getPath(Repository repository) ;
}

View File

@@ -48,10 +48,4 @@ public interface RepositoryDirectoryHandler extends RepositoryHandler {
* @return the current directory of the given repository
*/
File getDirectory(Repository repository);
/**
* get the initial directory of all repositories
* @return the initial directory of all repositories
*/
File getInitialBaseDirectory();
}