Project

General

Profile

« Previous | Next » 

Revision 6660

get params from multipart params for systemMetadataChanged call

View differences:

src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java
326 326
        String dateSysMetaLastModifiedStr = null;
327 327
        Identifier pid = null;
328 328
        
329
        // mkae sure we have the multipart params
330
        try {
331
			initMultipartParams();
332
		} catch (Exception e1) {
333
			throw new ServiceFailure("1333", "Could not collect the multipart params for the request");
334
		}
335
        
329 336
        // get the pid
330 337
        try {
331
        	String id = params.get("pid")[0];
338
        	String id = multipartparams.get("pid").get(0);
332 339
        	pid = new Identifier();
333 340
            pid.setValue(id);            
334 341
        } catch (NullPointerException e) {
......
339 346
        
340 347
        // get the serialVersion
341 348
        try {
342
            serialVersionStr = params.get("serialVersion")[0];
349
            serialVersionStr = multipartparams.get("serialVersion").get(0);
343 350
            serialVersion = new Long(serialVersionStr).longValue();
344 351
            
345 352
        } catch (NullPointerException e) {
......
351 358
        
352 359
        // get the dateSysMetaLastModified
353 360
        try {
354
            dateSysMetaLastModifiedStr = params.get("dateSysMetaLastModified")[0];
361
            dateSysMetaLastModifiedStr = multipartparams.get("dateSysMetaLastModified").get(0);
355 362
            dateSysMetaLastModified = DateTimeMarshaller.deserializeDateToUTC(dateSysMetaLastModifiedStr);
356 363
            
357 364
        } catch (NullPointerException e) {
src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java
550 550
            params.put(name, value);
551 551
        }
552 552
    }
553
    
554
    /**
555
     * Collect the multipart params from the request
556
     * @throws Exception 
557
     */
558
	protected void initMultipartParams() throws Exception {
559
		
560
		// Read the incoming data from its Mime Multipart encoding
561
		logMetacat.debug("Disassembling MIME multipart form");
562
	
563
		// handle MMP inputs
564
		File tmpDir = getTempDirectory();
565
		logMetacat.debug("temp dir: " + tmpDir.getAbsolutePath());
566
		MultipartRequestResolver mrr = 
567
			new MultipartRequestResolver(tmpDir.getAbsolutePath(), 1000000000, 0);
568
		MultipartRequest mr = mrr.resolveMultipart(request);
569
		
570
		multipartparams = mr.getMultipartParameters();
571
	}
553 572
   
554 573
    /**
555 574
     * locate the boundary marker for an MMP

Also available in: Unified diff