Project

General

Profile

« Previous | Next » 

Revision 9200

Added by Jing Tao almost 10 years ago

Add the code to check if the client is trying to update an archived object. If it is, reject it.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
385 385

  
386 386
            // get the existing system metadata for the object
387 387
            SystemMetadata existingSysMeta = getSystemMetadata(session, pid);
388
            //System.out.println("the archive is "+existingSysMeta.getArchived());
389
            //Base on documentation, we can't update an archived object:
390
            //The update operation MUST fail with Exceptions.InvalidRequest on objects that have the Types.SystemMetadata.archived property set to true.
391
            if(existingSysMeta.getArchived() != null && existingSysMeta.getArchived()) {
392
                throw new InvalidRequest("1202","An archived object"+pid.getValue()+" can't be updated");
393
            }
388 394

  
389 395
            // check for previous update
390 396
            // see: https://redmine.dataone.org/issues/3336

Also available in: Unified diff