mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
Remove dead code
This commit is contained in:
@@ -185,7 +185,7 @@ public class XmlRepositoryDAO
|
||||
|
||||
@Override
|
||||
public Repository getRepositoryForDirectory(File path) {
|
||||
for (RepositoryPath p : db.getPaths()) {
|
||||
for (RepositoryPath p : db.values()) {
|
||||
if (toRealPath(path.toPath()).startsWith(toRealPath(context.getBaseDirectory().toPath().resolve(p.getPath())))) {
|
||||
return p.getRepository();
|
||||
}
|
||||
@@ -204,7 +204,7 @@ public class XmlRepositoryDAO
|
||||
}
|
||||
|
||||
private Optional<RepositoryPath> findExistingRepositoryPath(Repository repository) {
|
||||
return db.getPaths().stream()
|
||||
return db.values().stream()
|
||||
.filter(repoPath -> repoPath.getId().equals(repository.getId()))
|
||||
.findAny();
|
||||
}
|
||||
|
||||
@@ -98,16 +98,6 @@ public class XmlRepositoryDatabase implements XmlDatabase<RepositoryPath> {
|
||||
return get(id) != null;
|
||||
}
|
||||
|
||||
public boolean contains(Repository repository)
|
||||
{
|
||||
return repositoryPathMap.containsKey(createKey(repository));
|
||||
}
|
||||
|
||||
public void remove(Repository repository)
|
||||
{
|
||||
repositoryPathMap.remove(createKey(repository));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepositoryPath remove(String id)
|
||||
{
|
||||
@@ -129,11 +119,6 @@ public class XmlRepositoryDatabase implements XmlDatabase<RepositoryPath> {
|
||||
return repositoryPathMap.values();
|
||||
}
|
||||
|
||||
public Collection<RepositoryPath> getPaths() {
|
||||
return repositoryPathMap.values();
|
||||
}
|
||||
|
||||
|
||||
public Repository get(NamespaceAndName namespaceAndName) {
|
||||
RepositoryPath repositoryPath = repositoryPathMap.get(createKey(namespaceAndName));
|
||||
if (repositoryPath != null) {
|
||||
|
||||
@@ -79,7 +79,7 @@ public class XmlRepositoryMapAdapter extends XmlAdapter<XmlRepositoryList, Map<S
|
||||
}
|
||||
}
|
||||
} catch (JAXBException ex) {
|
||||
throw new StoreException("failed to marshall repository database", ex);
|
||||
throw new StoreException("failed to marshal repository database", ex);
|
||||
}
|
||||
|
||||
return repositoryPaths;
|
||||
@@ -105,7 +105,7 @@ public class XmlRepositoryMapAdapter extends XmlAdapter<XmlRepositoryList, Map<S
|
||||
repositoryPathMap.put(XmlRepositoryDatabase.createKey(repository), repositoryPath);
|
||||
}
|
||||
} catch (JAXBException ex) {
|
||||
throw new StoreException("failed to unmarshall object", ex);
|
||||
throw new StoreException("failed to unmarshal object", ex);
|
||||
}
|
||||
return repositoryPathMap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user