mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
Remove dead code
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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) ;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user