Project

General

Profile

« Previous | Next » 

Revision 7090

Get the serialVersion param from the MMP params map rather than the request object params map in setAccess().

View differences:

src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java
773 773
        Identifier id = new Identifier();
774 774
        id.setValue(pid);
775 775

  
776
        logMetacat.debug("Calling delete");
776
        logMetacat.debug("Calling delete for identifier " + pid);
777 777
        CNodeService.getInstance(request).delete(session, id);
778 778
        TypeMarshaller.marshalTypeToOutputStream(id, out);
779 779
        
......
1032 1032

  
1033 1033
        long serialVersion = 0L;
1034 1034
        String serialVersionStr = null;
1035
        AccessPolicy accessPolicy = collectAccessPolicy();
1035 1036

  
1036 1037
        // get the serialVersion
1037 1038
        try {
1038
            serialVersionStr = params.get("serialVersion")[0];
1039
            serialVersionStr = multipartparams.get("serialVersion").get(0);
1039 1040
            serialVersion = new Long(serialVersionStr).longValue();
1040 1041

  
1042
        } catch (NumberFormatException nfe) {
1043
            String msg = "The 'serialVersion' must be provided as a positive integer and was not.";
1044
            logMetacat.error(msg);
1045
            throw new InvalidRequest("4402", msg);
1046
            
1041 1047
        } catch (NullPointerException e) {
1042 1048
            String msg = "The 'serialVersion' must be provided as a parameter and was not.";
1043 1049
            logMetacat.error(msg);
......
1048 1054
        Identifier id = new Identifier();
1049 1055
        id.setValue(pid);
1050 1056

  
1051
        AccessPolicy accessPolicy = collectAccessPolicy();
1052 1057
        CNodeService.getInstance(request).setAccessPolicy(session, id,
1053 1058
                accessPolicy, serialVersion);
1054 1059

  

Also available in: Unified diff