Project

General

Profile

« Previous | Next » 

Revision 9300

Added by Jing Tao over 9 years ago

Decode the string of the uri after we break the uri into parts base on the "/".

View differences:

src/edu/ucsb/nceas/metacat/restservice/v2/MNResourceHandler.java
250 250
                    if (httpVerb == GET) {
251 251
                    	// after the command
252 252
                        extra = parseTrailing(resource, RESOURCE_IS_AUTHORIZED);
253
                        extra = decode(extra);
253 254
	                	// check the access rules
254 255
	                    isAuthorized(extra);
255 256
	                    status = true;
......
262 263
                        logMetacat.debug("Using resource 'meta' for GET");
263 264
                    	// after the command
264 265
                        extra = parseTrailing(resource, RESOURCE_META);
266
                        extra = decode(extra);
265 267
                        getSystemMetadataObject(extra);
266 268
                        status = true;
267 269
                    } else if (httpVerb == PUT) {
......
274 276
                    logMetacat.debug("Using resource 'object'");
275 277
                    // after the command
276 278
                    extra = parseTrailing(resource, RESOURCE_OBJECTS);
279
                    extra = decode(extra);
277 280
                    logMetacat.debug("objectId: " + extra);
278 281
                    logMetacat.debug("verb:" + httpVerb);
279 282

  
......
307 310
                    // handle archive events
308 311
                    if (httpVerb == PUT) {
309 312
                        extra = parseTrailing(resource, Constants.RESOURCE_ARCHIVE);
313
                        extra = decode(extra);
310 314
                        archive(extra);
311 315
                        status = true;
312 316
                    }
......
316 320
                    if (httpVerb == GET) {
317 321
                    	// after the command
318 322
                        extra = parseTrailing(resource, Constants.RESOURCE_CHECKSUM);
323
                        extra = decode(extra);
319 324
                        checksum(extra);
320 325
                        status = true;
321 326
                    }
......
324 329
                    if (httpVerb == GET) {
325 330
                    	// after the command
326 331
                        extra = parseTrailing(resource, RESOURCE_MONITOR);
327
                        
332
                        extra = decode(extra);
328 333
                        // ping
329 334
                        if (extra.toLowerCase().equals("ping")) {
330 335
                            logMetacat.debug("processing ping request");
......
357 362
                    // get replica
358 363
                    if (httpVerb == GET) {
359 364
                        extra = parseTrailing(resource, RESOURCE_REPLICAS);
365
                        extra = decode(extra);
360 366
                        getReplica(extra);
361 367
                        status = true;
362 368
                    }
......
376 382
		                	engineIndex = extra.indexOf("/");
377 383
		                }
378 384
		                engine = extra.substring(0, engineIndex);
385
		                engine = decode(engine);
379 386
		                logMetacat.debug("query engine: " + engine);
380 387
		                
381 388
		                // get the query if it is there
......
391 398
		                		query = query.substring(1);
392 399
		                    }
393 400
		                }
401
		                query = decode(query);
394 402
		                logMetacat.debug("query: " + query);
395 403

  
396 404
	                }
......
411 419
                    if (httpVerb == PUT) {
412 420
                    	// after the command
413 421
                        extra = parseTrailing(resource, RESOURCE_PUBLISH);
422
                        extra = decode(extra);
414 423
                        publish(extra);
415 424
                        status = true;
416 425
                    }  
......
429 438
		                	formatIndex = extra.indexOf("/");
430 439
		                }
431 440
		                format = extra.substring(0, formatIndex);
441
		                format = decode(format);
432 442
		                logMetacat.debug("package format: " + format);
433 443
		                
434 444
		                // get the pid if it is there
......
440 450
		                		pid = pid.substring(1);
441 451
		                    }
442 452
		                }
453
		                pid = decode(pid);
443 454
		                logMetacat.debug("pid: " + pid);
444 455

  
445 456
	                }
......
466 477
		                	formatIndex = extra.indexOf("/");
467 478
		                }
468 479
		                format = extra.substring(0, formatIndex);
480
		                format = decode(format);
469 481
		                logMetacat.debug("view format: " + format);
470 482
		                
471 483
		                // get the pid if it is there
......
477 489
		                		pid = pid.substring(1);
478 490
		                    }
479 491
		                }
492
		                pid = decode(pid);
480 493
		                logMetacat.debug("pid: " + pid);
481 494

  
482 495
	                }

Also available in: Unified diff