Project

General

Profile

« Previous | Next » 

Revision 9298

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/v1/MNResourceHandler.java
232 232
                    if (httpVerb == GET) {
233 233
                    	// after the command
234 234
                        extra = parseTrailing(resource, RESOURCE_IS_AUTHORIZED);
235
                        extra = decode(extra);
235 236
	                	// check the access rules
236 237
	                    isAuthorized(extra);
237 238
	                    status = true;
......
243 244
                    if (httpVerb == GET) {
244 245
                    	// after the command
245 246
                        extra = parseTrailing(resource, RESOURCE_META);
247
                        extra = decode(extra);
246 248
                        getSystemMetadataObject(extra);
247 249
                        status = true;
248 250
                    }
......
251 253
                    logMetacat.debug("Using resource 'object'");
252 254
                    // after the command
253 255
                    extra = parseTrailing(resource, RESOURCE_OBJECTS);
256
                    logMetacat.debug("objectId(before decoded: " + extra);
257
                    extra = decode(extra);
254 258
                    logMetacat.debug("objectId: " + extra);
255 259
                    logMetacat.debug("verb:" + httpVerb);
256 260

  
......
284 288
                    // handle archive events
285 289
                    if (httpVerb == PUT) {
286 290
                        extra = parseTrailing(resource, Constants.RESOURCE_ARCHIVE);
291
                        extra = decode(extra);
287 292
                        archive(extra);
288 293
                        status = true;
289 294
                    }
......
293 298
                    if (httpVerb == GET) {
294 299
                    	// after the command
295 300
                        extra = parseTrailing(resource, Constants.RESOURCE_CHECKSUM);
301
                        extra = decode(extra);
296 302
                        checksum(extra);
297 303
                        status = true;
298 304
                    }
......
301 307
                    if (httpVerb == GET) {
302 308
                    	// after the command
303 309
                        extra = parseTrailing(resource, RESOURCE_MONITOR);
304
                        
310
                        extra = decode(extra);
305 311
                        // ping
306 312
                        if (extra.toLowerCase().equals("ping")) {
307 313
                            logMetacat.debug("processing ping request");
......
334 340
                    // get replica
335 341
                    if (httpVerb == GET) {
336 342
                        extra = parseTrailing(resource, RESOURCE_REPLICAS);
343
                        extra = decode(extra);
337 344
                        getReplica(extra);
338 345
                        status = true;
339 346
                    }
......
353 360
		                	engineIndex = extra.indexOf("/");
354 361
		                }
355 362
		                engine = extra.substring(0, engineIndex);
363
		                engine = decode(engine);
356 364
		                logMetacat.debug("query engine: " + engine);
357 365
		                
358 366
		                // get the query if it is there
359 367
		                query = extra.substring(engineIndex, extra.length());
368
		                query = decode(query);
360 369
		                if (query != null && query.length() == 0) {
361 370
		                	query = null;
362 371
		                } else {
......
388 397
                    if (httpVerb == PUT) {
389 398
                    	// after the command
390 399
                        extra = parseTrailing(resource, RESOURCE_PUBLISH);
400
                        extra = decode(extra);
391 401
                        publish(extra);
392 402
                        status = true;
393 403
                    }  
......
397 407
                    if (httpVerb == GET) {
398 408
                    	// after the command
399 409
                        extra = parseTrailing(resource, RESOURCE_PACKAGE);
410
                        extra = decode(extra);
400 411
                        getPackage(extra);
401 412
                        status = true;
402 413
                    }  
......
416 427
		                	formatIndex = extra.indexOf("/");
417 428
		                }
418 429
		                format = extra.substring(0, formatIndex);
430
		                format = decode(format);
419 431
		                logMetacat.debug("view format: " + format);
420 432
		                
421 433
		                // get the pid if it is there
......
427 439
		                		pid = pid.substring(1);
428 440
		                    }
429 441
		                }
442
		                pid = decode(pid);
430 443
		                logMetacat.debug("pid: " + pid);
431 444

  
432 445
	                }

Also available in: Unified diff