if ("default".equals(layout))
result.setLayout(new DefaultRepositoryLayout());
else if ("flat".equals(layout))
result.setLayout(new FlatRepositoryLayout());
else if ("p2".equals(layout))
result.setLayout(new P2ArtifactRepositoryLayout());
RepositoryPolicy releases = repository.getReleases();
if (releases != null)
result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
releases.getChecksumPolicy()));