Package org.apache.abdera.i18n.iri

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


        final String contentType = "application/atom+xml";
        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";
        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";
        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";
        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, "\"" + HTTPUtils.calculateHashETag(createdFeedEntry.toString().getBytes("utf-8")) + "\"" );
                }
                Date entryUpdated = createdFeedEntry.getUpdated();
                if ( entryUpdated != null ) {
View Full Code Here

    T entryObj,
    IRI feedIri,
    RequestContext request,
    boolean absolute) {
      feedIri = feedIri.trailingSlash();
      IRI entryIri = feedIri.resolve(UrlEncoding.encode(name, Profile.PATH.filter()));
   
      if (absolute) {
          entryIri = request.getResolvedUri().resolve(entryIri);
      }

      String link = entryIri.toString();
   
      String qp = getQueryParameters(entryObj, request);
      if (qp != null && !"".equals(qp)) {
        StringBuilder sb = new StringBuilder();
        sb.append(link)
View Full Code Here

    Iterable<T> entries = getEntries(request);
    if (entries != null) {
      for (T entryObj : entries) {
        Entry e = feed.addEntry();
 
        IRI feedIri = new IRI(getFeedIriForEntry(entryObj, request));
        addEntryDetails(request, e, feedIri, entryObj);

        if (isMediaEntry(entryObj)) {
          addMediaContent(feedIri, e, entryObj, request);
        } else {
View Full Code Here

    }
  }

  private IRI getFeedIRI(T entryObj, RequestContext request) {
    String feedIri = getFeedIriForEntry(entryObj, request);
    return new IRI(feedIri).trailingSlash();
  }
View Full Code Here

     
      if (entryObj == null) {
        return new EmptyResponseContext(404);
      }
     
      Entry orig_entry = getEntryFromCollectionProvider(entryObj, new IRI(getFeedIriForEntry(entryObj, request)), request);
      if (orig_entry != null) {

        MimeType contentType = request.getContentType();
        if (contentType != null && !MimeTypeHelper.isAtom(contentType.toString()))
          return new EmptyResponseContext(415);
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.