1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.internal.impl.synccontext.named;
20
21 import java.util.Collection;
22 import java.util.Collections;
23
24 import org.eclipse.aether.RepositorySystemSession;
25 import org.eclipse.aether.artifact.Artifact;
26 import org.eclipse.aether.metadata.Metadata;
27
28
29
30
31
32 public class StaticNameMapper implements NameMapper {
33 @Override
34 public boolean isFileSystemFriendly() {
35 return true;
36 }
37
38 @Override
39 public Collection<String> nameLocks(
40 final RepositorySystemSession session,
41 final Collection<? extends Artifact> artifacts,
42 final Collection<? extends Metadata> metadatas) {
43 if (artifacts != null && !artifacts.isEmpty()) {
44 return Collections.singletonList("static-artifact");
45 } else if (metadatas != null && !metadatas.isEmpty()) {
46 return Collections.singletonList("static-metadata");
47
48 } else {
49 return Collections.emptyList();
50 }
51 }
52 }