Package org.apache.abdera.i18n.iri

Examples of org.apache.abdera.i18n.iri.IRI


        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        // AtomTestCaseUtils.printRequestHeaders( "Post request headers", "   ", opts );
        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        ClientResponse res = client.post(colUri.toString(), entry, opts);

        // Assert response status code is 201-OK.
        // Assert response header Content-Type: application/atom+xml; charset=UTF-8
        // Assert response header Location: http://example.org/edit/first-post.atom
        // Assert response header Content-Location: http://example.org/edit/first-post.atom
View Full Code Here


        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-None-Match", eTag);

        // AtomTestCaseUtils.printRequestHeaders( "Put request headers", "   ", opts );
        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.put(colUri.toString() + "/" + id, new BaseRequestEntity( entry ), opts);
        // Expected Atom server response (item was edited by another user)
        // >      HTTP/1.1 412 Precondition Failed
        //       Date: Sat, 24 Feb 2007 16:34:11 GMT

        // If-Match Assert response status code is 412. Precondition failed.
View Full Code Here

        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-None-Match", "123456");
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
        // Expected Atom server response (item was edited by another user)
        // >      HTTP/1.1 412 Precondition Failed
        //       Date: Sat, 24 Feb 2007 16:34:11 GMT

        // Atom server response (item was up to date)
View Full Code Here

        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-None-Match", eTag);
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching   

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
        // Atom server response (item was up to date)
        // >      HTTP/1.1 304 Not Modified
        //       Date: Sat, 24 Feb 2007 13:17:11 GMT

        // Assert response status code is 304 Not Modified.
View Full Code Here

        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 2025 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.get(colUri.toString() + "/" + id, opts);
        ClientResponse res = client.execute( "GET", colUri.toString(), (BaseRequestEntity)null, opts);

        // Atom server response (item was up to date)
        // >      HTTP/1.1 304 Not Modified
        //       Date: Sat, 24 Feb 2007 13:17:11 GMT
View Full Code Here

        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 1844 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.get(colUri.toString() + "/" + id, opts);

        // Atom server response (item was up to date)
        // >      HTTP/1.1 200 OK
        //        Date: Sat, 24 Feb 2007 13:17:11 GMT
        // >      ETag: "bb4f5e86e92ddb8549604a0df0763581"
View Full Code Here

        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-Unmodified-Since", "Sat, 29 Oct 2050 19:43:31 GMT" );
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.get(colUri.toString() + "/" + id, opts);

        // Atom server response (item was up to date)
        // >      HTTP/1.1 200 OK
        //        Date: Sat, 24 Feb 2007 13:17:11 GMT
        // >      ETag: "bb4f5e86e92ddb8549604a0df0763581"
View Full Code Here

        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
        opts.setHeader( "If-Unmodified-Since", "Sat, 29 Oct 1844 19:43:31 GMT" );
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.get(colUri.toString() + "/" + id, opts);

        // Atom server response (item was up to date)
        // >      HTTP/1.1 304 Not Modified
        //       Date: Sat, 24 Feb 2007 13:17:11 GMT
View Full Code Here

            if ( title != null ) {
                workspace.setTitle(title);
            } else {
                workspace.setTitle("workspace");
            }
            workspace.setBaseUri( new IRI( workspaceURL ));

            Collection collection = workspace.addCollection("collection", href );
            Feed feed = getFeed( request );
            if ( feed != null ) {
                String title = feed.getTitle();
View Full Code Here

            }

            // A new entry for non-media was created successfully.
            if (createdFeedEntry != null) {
                // Set location of the created entry in the Location header
                IRI feedId = createdFeedEntry.getId();
                if ( feedId != null ) {
                    response.addHeader(ETAG, "\"" + feedId.toString() + "\"" );
                }
                Date entryUpdated = createdFeedEntry.getUpdated();
                if ( entryUpdated != null ) {
                    response.addHeader(LASTMODIFIED, dateFormat.format( entryUpdated ));
                }
View Full Code Here

TOP

Related Classes of org.apache.abdera.i18n.iri.IRI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.