KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > joseki > HttpRemove


1 /*
2  * (c) Copyright 2003, 2004 Hewlett-Packard Development Company, LP
3  * [See end of file]
4  */

5
6 package com.hp.hpl.jena.joseki;
7
8 import java.net.* ;
9 import com.hp.hpl.jena.rdf.model.*;
10
11 /** Remove statements to a remote model.
12  * A typical code sequence might be:
13  * <pre>
14  * HttpRemove removeOp = new HttpRemove(URL of target) ;
15  * removeOp.setModel(your model);
16  * addOp.exec() ; // Result is an empty model
17  * </pre>
18  * or
19  * <pre>
20  * HttpRemove removeOp = new HttpRemove(URL of target) ;
21  * // Collect statements to be added
22  * removeOp.remove(statement) ;
23  * removeOp.remove(model) ; // Remove all the statements as given in a model
24  * removeOp.remove() ; // Result is an empty model
25  * </pre>
26
27  * Any problems cause {@link HttpException} to be thrown on .exec()
28  *
29  * @author Andy Seaborne
30  * @version $Id: HttpRemove.java,v 1.7 2004/04/30 14:13:13 andy_seaborne Exp $
31  */

32 public class HttpRemove extends HttpExecuteModel
33 {
34     /** Create an operation for removing statements to a remote model */
35     public HttpRemove(URL url) throws MalformedURLException
36     {
37         this(url.toString()) ;
38     }
39     
40     public HttpRemove(String JavaDoc urlStr) throws MalformedURLException
41     {
42         super(urlStr, "remove") ;
43     }
44     
45     /** Accumulate statements to be removed when the operations is executed
46      * @param model A set of statements to be removed on execution
47      */

48    public void remove(Model model) { collect(model) ; }
49     
50     /** Accumulate statements to be removed when the operations is executed
51      * @param statement A statement to be removed on execution
52      */

53     public void remove(Statement statement) { collect(statement) ; }
54 }
55
56 /*
57  * (c) Copyright 2003, 2004 Hewlett-Packard Development Company, LP
58  * All rights reserved.
59  *
60  * Redistribution and use in source and binary forms, with or without
61  * modification, are permitted provided that the following conditions
62  * are met:
63  * 1. Redistributions of source code must retain the above copyright
64  * notice, this list of conditions and the following disclaimer.
65  * 2. Redistributions in binary form must reproduce the above copyright
66  * notice, this list of conditions and the following disclaimer in the
67  * documentation and/or other materials provided with the distribution.
68  * 3. The name of the author may not be used to endorse or promote products
69  * derived from this software without specific prior written permission.
70  *
71  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
72  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
73  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
74  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
75  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
76  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
77  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
78  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
79  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
80  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
81  */

82  
83
Popular Tags