Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2010 MediaShelf <http://www.yourmediashelf.com/> This file is part of fedora-client. fedora-client is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. fedora-client is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with fedora-client. If not, see <http://www.gnu.org/licenses/>.
 
 
 package com.yourmediashelf.fedora.client.request;
 
 import java.util.Date;
 
Builder for the PurgeDatastream method.

Author(s):
Edwin Shin
 
 public class PurgeDatastream extends FedoraRequest<PurgeDatastream> {
 
     private final String pid;
 
     private final String dsId;
 
     public PurgeDatastream(String pidString dsId) {
         this. = pid;
         this. = dsId;
     }
 
     public PurgeDatastream logMessage(String logMessage) {
         addQueryParam("logMessage"logMessage);
         return this;
     }

    

Parameters:
startDT the (inclusive) start date-time stamp of the range. If not specified, this is taken to be the lowest possible value, and thus, the entire version history up to the endDT will be purged.
Returns:
this builder
 
     public PurgeDatastream startDT(String startDT) {
         addQueryParam("startDT"startDT);
         return this;
     }
 
     public PurgeDatastream startDT(Date startDT) {
         addQueryParam("startDT", DateUtility.getXSDDateTime(startDT));
         return this;
     }

    

Parameters:
endDT the (inclusive) ending date-time stamp of the range. If not specified, this is taken to be the greatest possible value, and thus, the entire version history back to the startDT will be purged.
Returns:
this builder
 
     public PurgeDatastream endDT(String endDT) {
         addQueryParam("endDT"endDT);
         return this;
     }
 
     public PurgeDatastream endDT(Date endDT) {
         addQueryParam("endDT", DateUtility.getXSDDateTime(endDT));
         return this;
     }
 
     @Override
         return (PurgeDatastreamResponsesuper.execute();
     }
 
     @Override
     public PurgeDatastreamResponse execute(FedoraClient fedora)
             throws FedoraClientException {
         String path = String.format("objects/%s/datastreams/%s");
 
         WebResource wr =
                 resource(fedora).path(path).queryParams(getQueryParams());
         ClientResponse cr = wr.delete(ClientResponse.class);
         return new PurgeDatastreamResponse(cr);
    }
New to GrepCode? Check out our FAQ X