Project

General

Profile

« Previous | Next » 

Revision 8901

Added by Jing Tao almost 10 years ago

Added the code to check if a not-found object was deleted in the isAuthorized method.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
988 988
    
989 989
    // throw not found if it was not found
990 990
    if (systemMetadata == null) {
991
    	throw new NotFound("1800", "No system metadata could be found for given PID: " + pidStr);
991
        String localId = null;
992
        String error = "No system metadata could be found for given PID: " + pidStr;
993
        try {
994
            localId = IdentifierManager.getInstance().getLocalId(pid.getValue());
995
          
996
         } catch (Exception e) {
997
            logMetacat.warn("Couldn't find the local id for the pid "+pidStr);
998
        }
999
        
1000
        if(localId != null && EventLog.getInstance().isDeleted(localId)) {
1001
            error = error + ". The object with the PID has been deleted from the node.";
1002
        }
1003
        throw new NotFound("1800", error);
992 1004
    }
993 1005
	    
994 1006
    // do we own it?

Also available in: Unified diff