This project has retired. For details please refer to its
Attic page.
MavenRepositoryGroup xref
1 package org.apache.archiva.repository.maven2;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.archiva.common.filelock.DefaultFileLockManager;
23 import org.apache.archiva.common.filelock.FileLockManager;
24 import org.apache.archiva.repository.*;
25 import org.apache.archiva.repository.base.AbstractRepositoryGroup;
26 import org.apache.archiva.repository.storage.FilesystemStorage;
27 import org.apache.archiva.repository.features.IndexCreationFeature;
28 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory;
30
31 import java.io.IOException;
32 import java.nio.file.Path;
33 import java.util.Locale;
34
35 public class MavenRepositoryGroup extends AbstractRepositoryGroup implements EditableRepositoryGroup {
36
37 private static final RepositoryCapabilities CAPABILITIES = new StandardCapabilities(
38 new ReleaseScheme[] { ReleaseScheme.RELEASE, ReleaseScheme.SNAPSHOT },
39 new String[] { MavenManagedRepository.DEFAULT_LAYOUT, MavenManagedRepository.LEGACY_LAYOUT},
40 new String[] {},
41 new String[] {IndexCreationFeature.class.getName()},
42 false,
43 false,
44 false,
45 false,
46 false
47 );
48
49 private final Logger log = LoggerFactory.getLogger(MavenRepositoryGroup.class);
50
51 private IndexCreationFeature indexCreationFeature;
52
53
54 public MavenRepositoryGroup(String id, String name, FilesystemStorage storage) {
55 super(RepositoryType.MAVEN, id, name, storage);
56 init();
57 }
58
59 public MavenRepositoryGroup(Locale primaryLocale, String id, String name, FilesystemStorage storage) {
60 super(primaryLocale, RepositoryType.MAVEN, id, name, storage);
61 init();
62 }
63
64 private Path getRepositoryPath() {
65 return getStorage().getAsset("").getFilePath();
66 }
67
68 private void init() {
69 setCapabilities(CAPABILITIES);
70 this.indexCreationFeature = new IndexCreationFeature(this, this);
71 addFeature( this.indexCreationFeature );
72 }
73
74 public static MavenRepositoryGroup newLocalInstance(String id, String name, Path basePath) throws IOException {
75 FileLockManager lockManager = new DefaultFileLockManager();
76 FilesystemStorage/FilesystemStorage.html#FilesystemStorage">FilesystemStorage storage = new FilesystemStorage(basePath.resolve(id), lockManager);
77 return new MavenRepositoryGroup(id, name, storage);
78 }
79 }