Package org.wymiwyg.commons.util.http

Examples of org.wymiwyg.commons.util.http.ServerAddress


      loadCache();
      // return;
    }
    String serverName;
    String hostHeader = request.getHeaderValues(HeaderName.HOST)[0];
    ServerAddress requested = new ServerAddress(request.getScheme().getStringRepresentation()+"://"+hostHeader);
    if (log.isDebugEnabled()) {
      log.debug("Request ServerAddress: " + requested);
    }
    ServerAddress canonicalAddress = (ServerAddress) hostReplacement
        .get(requested);
    if (canonicalAddress != null) {
      if (!requested.equals(canonicalAddress)) {
        sendRedirect(canonicalAddress, request, response);
        return;
View Full Code Here


          .listSubjectsWithProperty(RDF.type,
              HOSTCANONICALIZER.DefaultCanonicalizer);
      Resource defaultCanonicalizer;
      if (defaultCanonicalizerIter.hasNext()) {
        defaultCanonicalizer = defaultCanonicalizerIter.nextResource();
        defaultCanonicalBase = new ServerAddress(defaultCanonicalizer
            .getRequiredProperty(HOSTCANONICALIZER.canonicalBase)
            .getResource().getURI());
        canonicalBaseSet.add(defaultCanonicalBase);
      } else {
        defaultCanonicalBase = null;
      }
      defaultCanonicalizerIter.close();
      ResIterator canonicalizerIter = model.listSubjectsWithProperty(
          RDF.type, HOSTCANONICALIZER.Canonicalizer);
      Resource canonicalizer;
      while (canonicalizerIter.hasNext()) {
        try {
          canonicalizer = canonicalizerIter.nextResource();
          String canonicalBaseString = canonicalizer
              .getRequiredProperty(
                  HOSTCANONICALIZER.canonicalBase)
              .getResource().getURI();
          String accessBase = canonicalizer.getRequiredProperty(
              HOSTCANONICALIZER.accessURLBase).getResource()
              .getURI();
          ServerAddress canonicalBase = new ServerAddress(
              canonicalBaseString);
          hostReplacement.put(new ServerAddress(accessBase),
              canonicalBase);
          canonicalBaseSet.add(canonicalBase);
          if (log.isDebugEnabled()) {
            log.debug("added host replacement: " + accessBase
                + " to " + canonicalBase);
View Full Code Here

        foafAgent.addProperty(FOAF.mbox, model.createResource(mbox));
        foafAgent.addProperty(FOAF.mbox_sha1sum, Util.sha1(mbox));
      }
      String serverName;
      String hostHeader = request.getHeaderValues(HeaderName.HOST)[0];
      ServerAddress requested = new ServerAddress(request.getScheme().getStringRepresentation()+"://"+hostHeader);
      Resource newCanonicalizer = model
          .createResource(HOSTCANONICALIZER.Canonicalizer);
      newCanonicalizer.addProperty(
          HOSTCANONICALIZER.accessURLBase, model
              .createResource(requested
                  .toString()));
      Resource canonicalBaseResource = model
      .createResource(canonicalBase);
      newCanonicalizer.addProperty(
          HOSTCANONICALIZER.canonicalBase, canonicalBaseResource);
View Full Code Here

TOP

Related Classes of org.wymiwyg.commons.util.http.ServerAddress

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.