Revision 9299
Added by Jing Tao over 9 years ago
src/edu/ucsb/nceas/metacat/restservice/v2/CNResourceHandler.java | ||
---|---|---|
172 | 172 |
logMetacat.debug("Setting access policy"); |
173 | 173 |
// after the command |
174 | 174 |
extra = parseTrailing(resource, RESOURCE_ACCESS_RULES); |
175 |
extra = decode(extra); |
|
175 | 176 |
setAccess(extra); |
176 | 177 |
status = true; |
177 | 178 |
logMetacat.debug("done setting access"); |
... | ... | |
181 | 182 |
|
182 | 183 |
// after the command |
183 | 184 |
extra = parseTrailing(resource, RESOURCE_META); |
184 |
|
|
185 |
extra = decode(extra); |
|
185 | 186 |
// get |
186 | 187 |
if (httpVerb == GET) { |
187 | 188 |
getSystemMetadataObject(extra); |
... | ... | |
208 | 209 |
|
209 | 210 |
// after the command |
210 | 211 |
extra = parseTrailing(resource, RESOURCE_RESOLVE); |
211 |
|
|
212 |
extra = decode(extra); |
|
212 | 213 |
// resolve the object location |
213 | 214 |
if (httpVerb == GET) { |
214 | 215 |
resolve(extra); |
... | ... | |
218 | 219 |
|
219 | 220 |
// after the command |
220 | 221 |
extra = parseTrailing(resource, RESOURCE_OWNER); |
221 |
|
|
222 |
extra = decode(extra); |
|
222 | 223 |
// set the owner |
223 | 224 |
if (httpVerb == PUT) { |
224 | 225 |
owner(extra); |
... | ... | |
228 | 229 |
|
229 | 230 |
// after the command |
230 | 231 |
extra = parseTrailing(resource, RESOURCE_IS_AUTHORIZED); |
231 |
|
|
232 |
extra = decode(extra); |
|
232 | 233 |
// authorized? |
233 | 234 |
if (httpVerb == GET) { |
234 | 235 |
isAuthorized(extra); |
... | ... | |
241 | 242 |
|
242 | 243 |
// after the command |
243 | 244 |
extra = parseTrailing(resource, RESOURCE_OBJECTS); |
244 |
|
|
245 |
extra = decode(extra); |
|
245 | 246 |
logMetacat.debug("objectId: " + extra); |
246 | 247 |
logMetacat.debug("verb:" + httpVerb); |
247 | 248 |
|
... | ... | |
268 | 269 |
|
269 | 270 |
// after the command |
270 | 271 |
extra = parseTrailing(resource, RESOURCE_FORMATS); |
271 |
|
|
272 |
extra = decode(extra); |
|
272 | 273 |
// handle each verb |
273 | 274 |
if (httpVerb == GET) { |
274 | 275 |
if (extra == null) { |
... | ... | |
296 | 297 |
// handle archive events |
297 | 298 |
if (httpVerb == PUT) { |
298 | 299 |
extra = parseTrailing(resource, Constants.RESOURCE_ARCHIVE); |
300 |
extra = decode(extra); |
|
299 | 301 |
archive(extra); |
300 | 302 |
status = true; |
301 | 303 |
} |
... | ... | |
304 | 306 |
|
305 | 307 |
// after the command |
306 | 308 |
extra = parseTrailing(resource, Constants.RESOURCE_CHECKSUM); |
307 |
|
|
309 |
extra = decode(extra); |
|
308 | 310 |
// handle checksum requests |
309 | 311 |
if (httpVerb == GET) { |
310 | 312 |
|
... | ... | |
325 | 327 |
+ RESOURCE_REPLICATION_POLICY); |
326 | 328 |
// get the trailing pid |
327 | 329 |
extra = parseTrailing(resource, RESOURCE_REPLICATION_POLICY); |
330 |
extra = decode(extra); |
|
328 | 331 |
setReplicationPolicy(extra); |
329 | 332 |
status = true; |
330 | 333 |
|
... | ... | |
335 | 338 |
+ RESOURCE_REPLICATION_META); |
336 | 339 |
// get the trailing pid |
337 | 340 |
extra = parseTrailing(resource, RESOURCE_REPLICATION_META); |
341 |
extra = decode(extra); |
|
338 | 342 |
updateReplicationMetadata(extra); |
339 | 343 |
status = true; |
340 | 344 |
|
... | ... | |
345 | 349 |
+ RESOURCE_REPLICATION_NOTIFY); |
346 | 350 |
// get the trailing pid |
347 | 351 |
extra = parseTrailing(resource, RESOURCE_REPLICATION_NOTIFY); |
352 |
extra = decode(extra); |
|
348 | 353 |
setReplicationStatus(extra); |
349 | 354 |
status = true; |
350 | 355 |
|
... | ... | |
356 | 361 |
// get the trailing pid |
357 | 362 |
extra = parseTrailing(resource, |
358 | 363 |
RESOURCE_REPLICATION_AUTHORIZED); |
364 |
extra = decode(extra); |
|
359 | 365 |
isNodeAuthorized(extra); |
360 | 366 |
status = true; |
361 | 367 |
|
... | ... | |
363 | 369 |
if (httpVerb == GET) { |
364 | 370 |
// after the command |
365 | 371 |
extra = parseTrailing(resource, Constants.RESOURCE_MONITOR_PING); |
366 |
|
|
372 |
extra = decode(extra); |
|
367 | 373 |
logMetacat.debug("processing ping request"); |
368 | 374 |
Date result = CNodeService.getInstance(request).ping(); |
369 | 375 |
// TODO: send to output |
... | ... | |
376 | 382 |
+ Constants.RESOURCE_META_OBSOLETEDBY); |
377 | 383 |
// get the trailing pid |
378 | 384 |
extra = parseTrailing(resource, Constants.RESOURCE_META_OBSOLETEDBY); |
385 |
extra = decode(extra); |
|
379 | 386 |
setObsoletedBy(extra); |
380 | 387 |
status = true; |
381 | 388 |
} else if (resource.startsWith(Constants.RESOURCE_REPLICATION_DELETE_REPLICA) |
... | ... | |
385 | 392 |
+ Constants.RESOURCE_REPLICATION_DELETE_REPLICA); |
386 | 393 |
// get the trailing pid |
387 | 394 |
extra = parseTrailing(resource, Constants.RESOURCE_REPLICATION_DELETE_REPLICA); |
395 |
extra = decode(extra); |
|
388 | 396 |
deleteReplica(extra); |
389 | 397 |
status = true; |
390 | 398 |
} else if (resource.startsWith(RESOURCE_VIEWS)) { |
... | ... | |
405 | 413 |
} else { |
406 | 414 |
throw new InvalidRequest("2853", "The request doesn't specify the name of theme."); |
407 | 415 |
} |
416 |
format = decode(format); |
|
408 | 417 |
logMetacat.info("view format: " + format); |
409 | 418 |
|
410 | 419 |
// get the pid if it is there |
... | ... | |
416 | 425 |
pid = pid.substring(1); |
417 | 426 |
} |
418 | 427 |
} |
428 |
pid=decode(pid); |
|
419 | 429 |
logMetacat.debug("pid: " + pid); |
420 | 430 |
|
421 | 431 |
} |
Also available in: Unified diff
Decode the string of the uri after we break the uri into parts base on the "/".