Project

General

Profile

« Previous | Next » 

Revision 7077

View differences:

CNResourceHandler.java
249 249
                    } else if (httpVerb == HEAD) {
250 250
                        describeObject(extra);
251 251
                        status = true;
252
                    }
252
                    } else if (httpVerb == DELETE) {
253
                        deleteObject(extra);
254
                        status = true;
255
                    } 
253 256

  
254 257
                } else if (resource.startsWith(RESOURCE_FORMATS)) {
255 258
                    logMetacat.debug("Using resource: " + RESOURCE_FORMATS);
......
747 750
        response.addHeader("DataONE-SerialVersion", dr.getSerialVersion().toString());
748 751

  
749 752
    }
753
    
754
    /**
755
     * Handle delete 
756
     * @param pid ID of data object to be deleted
757
     * @throws IOException
758
     * @throws InvalidRequest 
759
     * @throws NotImplemented 
760
     * @throws NotFound 
761
     * @throws NotAuthorized 
762
     * @throws ServiceFailure 
763
     * @throws InvalidToken 
764
     * @throws JiBXException 
765
     */
766
    private void deleteObject(String pid) throws IOException, InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InvalidRequest, JiBXException 
767
    {
750 768

  
769
        OutputStream out = response.getOutputStream();
770
        response.setStatus(200);
771
        response.setContentType("text/xml");
772

  
773
        Identifier id = new Identifier();
774
        id.setValue(pid);
775

  
776
        logMetacat.debug("Calling delete");
777
        CNodeService.getInstance(request).delete(session, id);
778
        TypeMarshaller.marshalTypeToOutputStream(id, out);
779
        
780
    }
781

  
751 782
    /**
752 783
     * Return the requested object format
753 784
     * 

Also available in: Unified diff