1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.spi.connector;
20
21 import java.io.File;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.eclipse.aether.RequestTrace;
26 import org.eclipse.aether.metadata.Metadata;
27 import org.eclipse.aether.repository.RemoteRepository;
28 import org.eclipse.aether.transfer.MetadataTransferException;
29 import org.eclipse.aether.transfer.TransferListener;
30
31
32
33
34
35 public final class MetadataDownload extends MetadataTransfer {
36
37 private String checksumPolicy = "";
38
39 private String context = "";
40
41 private List<RemoteRepository> repositories = Collections.emptyList();
42
43
44
45
46 public MetadataDownload() {
47
48 }
49
50
51
52
53
54
55
56
57
58 public MetadataDownload(Metadata metadata, String context, File file, String checksumPolicy) {
59 setMetadata(metadata);
60 setFile(file);
61 setChecksumPolicy(checksumPolicy);
62 setRequestContext(context);
63 }
64
65 @Override
66 public MetadataDownload setMetadata(Metadata metadata) {
67 super.setMetadata(metadata);
68 return this;
69 }
70
71 @Override
72 public MetadataDownload setFile(File file) {
73 super.setFile(file);
74 return this;
75 }
76
77
78
79
80
81
82 public String getChecksumPolicy() {
83 return checksumPolicy;
84 }
85
86
87
88
89
90
91
92 public MetadataDownload setChecksumPolicy(String checksumPolicy) {
93 this.checksumPolicy = (checksumPolicy != null) ? checksumPolicy : "";
94 return this;
95 }
96
97
98
99
100
101
102 public String getRequestContext() {
103 return context;
104 }
105
106
107
108
109
110
111
112 public MetadataDownload setRequestContext(String context) {
113 this.context = (context != null) ? context : "";
114 return this;
115 }
116
117
118
119
120
121
122
123 public List<RemoteRepository> getRepositories() {
124 return repositories;
125 }
126
127
128
129
130
131
132
133
134 public MetadataDownload setRepositories(List<RemoteRepository> repositories) {
135 if (repositories == null) {
136 this.repositories = Collections.emptyList();
137 } else {
138 this.repositories = repositories;
139 }
140 return this;
141 }
142
143 @Override
144 public MetadataDownload setException(MetadataTransferException exception) {
145 super.setException(exception);
146 return this;
147 }
148
149 @Override
150 public MetadataDownload setListener(TransferListener listener) {
151 super.setListener(listener);
152 return this;
153 }
154
155 @Override
156 public MetadataDownload setTrace(RequestTrace trace) {
157 super.setTrace(trace);
158 return this;
159 }
160
161 @Override
162 public String toString() {
163 return getMetadata() + " - " + getFile();
164 }
165 }