1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
/*******************************************************************************
* Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Red Hat Inc. - Fix compiler problems from generified IAdaptable#getAdapter
*******************************************************************************/
package org.eclipse.equinox.internal.p2.updatesite.artifact;
import java.io.OutputStream;
import java.net.URI;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRunnableWithProgress;
import org.eclipse.equinox.p2.repository.artifact.*;
public class UpdateSiteArtifactRepository implements IArtifactRepository {
public static final String TYPE = "org.eclipse.equinox.p2.updatesite.artifactRepository"; //$NON-NLS-1$
public static final String VERSION = Integer.toString(1);
private URI location;
private IArtifactRepository delegate;
public UpdateSiteArtifactRepository(URI location, IArtifactRepository repository) {
this.location = location;
this.delegate = repository;
}
@Override
public void addDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void addDescriptor(IArtifactDescriptor descriptor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public void addDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void addDescriptors(IArtifactDescriptor[] descriptors) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public boolean contains(IArtifactDescriptor descriptor) {
return delegate.contains(descriptor);
}
@Override
public boolean contains(IArtifactKey key) {
return delegate.contains(key);
}
@Override
public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
return delegate.getArtifact(descriptor, destination, monitor);
}
@Override
public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
return delegate.getArtifactDescriptors(key);
}
@Override
public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) {
return delegate.getArtifacts(requests, monitor);
}
@Override
public OutputStream getOutputStream(IArtifactDescriptor descriptor) throws ProvisionException {
// TODO Auto-generated method stub
return null;
}
@Override
public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
return delegate.getRawArtifact(descriptor, destination, monitor);
}
@Override
public void removeAll(IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void removeAll() {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public void removeDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void removeDescriptor(IArtifactDescriptor descriptor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public void removeDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void removeDescriptors(IArtifactDescriptor[] descriptors) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public void removeDescriptor(IArtifactKey key, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void removeDescriptor(IArtifactKey key) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public void removeDescriptors(IArtifactKey[] keys, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
@Deprecated
public void removeDescriptors(IArtifactKey[] keys) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public String getDescription() {
return delegate.getDescription();
}
@Override
public URI getLocation() {
return this.location;
}
@Override
public String getName() {
return delegate.getName();
}
@Override
public Map<String, String> getProperties() {
return delegate.getProperties();
}
@Override
public String getProperty(String key) {
return delegate.getProperty(key);
}
@Override
public String getProvider() {
return delegate.getProvider();
}
@Override
public IProvisioningAgent getProvisioningAgent() {
return delegate.getProvisioningAgent();
}
@Override
public String getType() {
return TYPE;
}
@Override
public String getVersion() {
return VERSION;
}
@Override
public boolean isModifiable() {
return false;
}
public void setDescription(String description) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
public void setName(String name) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public String setProperty(String key, String value, IProgressMonitor monitor) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public String setProperty(String key, String value) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
public void setProvider(String provider) {
throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$
}
@Override
public <T> T getAdapter(Class<T> adapter) {
return delegate.getAdapter(adapter);
}
@Override
public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
return delegate.createArtifactDescriptor(key);
}
@Override
public IArtifactKey createArtifactKey(String classifier, String id, Version version) {
return delegate.createArtifactKey(classifier, id, version);
}
@Override
public IQueryable<IArtifactDescriptor> descriptorQueryable() {
return delegate.descriptorQueryable();
}
@Override
public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
return delegate.query(query, monitor);
}
@Override
public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor) {
return delegate.executeBatch(runnable, monitor);
}
}
|