Remove dead code

This commit is contained in:
René Pfeuffer
2018-11-26 12:48:41 +01:00
parent 282b5687a6
commit 095198cf74
7 changed files with 11 additions and 55 deletions

View File

@@ -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();
}

View File

@@ -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) {

View File

@@ -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;
}