Examples of URLEncoder


Examples of org.apache.wicket.util.encoding.UrlEncoder

        Charset charset = url.getCharset();

        Url mergedUrl = Url.parse(url.toString(), charset);

        UrlEncoder urlEncoder = UrlEncoder.QUERY_INSTANCE;

        Set<String> setParameters = new HashSet<String>();

        int indexedCount = params.getIndexedCount();
        if (indexedCount > 0)
        {
            String jsessionidString = null;
            List<String> segments = mergedUrl.getSegments();
            if (segments.size() > 0)
            {
                String lastSegment = segments.get(segments.size() - 1);
                int jsessionidIndex = lastSegment.indexOf(";jsessionid=");
                if (jsessionidIndex != -1)
                {
                   segments.set(segments.size() - 1, lastSegment.substring(0, jsessionidIndex));
                   jsessionidString = lastSegment.substring(jsessionidIndex);
                }
            }
            for (int i = 0; i < indexedCount; i++)
            {
                segments.add(params.get(i).toString());
            }
            if (jsessionidString != null)
            {
                segments.set(segments.size() - 1, segments.get(segments.size() - 1).concat(jsessionidString));
            }
        }

        for (INamedParameters.NamedPair pair : params.getAllNamed())
        {
            String key = urlEncoder.encode(pair.getKey(), charset);
            String value = urlEncoder.encode(pair.getValue(), charset);

            if (setParameters.contains(key)) {
                mergedUrl.addQueryParameter(key, value);
            } else {
                mergedUrl.setQueryParameter(key, value);
View Full Code Here

Examples of org.jboss.dna.common.text.UrlEncoder

            this.context = context;
            this.sourceName = nameOfSourceToBeSearchable;
            this.connectionFactory = connectionFactory;
            // Define the configuration ...
            TextEncoder encoder = new UrlEncoder();
            if (indexDirectory != null) {
                File indexDir = new File(indexDirectory);
                if (indexDir.exists()) {
                    // The location does exist ...
                    if (!indexDir.isDirectory()) {
View Full Code Here

Examples of org.mockserver.url.URLEncoder

*/
public class URLEncoderTest {

    @Test
    public void shouldEncodeCharacters() {
        assertEquals("%7B%7D%5B%5D%5E%C2%A3%5C%7C", new URLEncoder().encodeURL("{}[]^£\\|"));
    }
View Full Code Here

Examples of org.olat.core.commons.servlets.util.URLEncoder

  public OLATResourceable getOLATResourceable() {
    return olatResourceable;
  }
 
  public String toString(){
    URLEncoder urlE = new URLEncoder();
    String resource =urlE.encode(this.olatResourceable.getResourceableTypeName());
    return "["+resource+":"+this.olatResourceable.getResourceableId()+"]";
  }
View Full Code Here

Examples of org.olat.core.commons.servlets.util.URLEncoder

  public static String getJumpInUri(BusinessControl bc) {
    StringBuilder sb = new StringBuilder();
    sb.append(Settings.getServerContextPathURI()).append(DispatcherAction.PATH_AUTHENTICATED).append(CONST_EXTLINK).append("?");
    sb.append(CONST_RESOURCE_URL);
    sb.append("=");
    sb.append( new URLEncoder().encode(bc.getAsString()) );
    return sb.toString();
  }
View Full Code Here

Examples of org.olat.core.commons.servlets.util.URLEncoder

        for (ContextEntry contextEntry : businessControls) {
          //retVal = contextEntry+retVal;
          /**
           * possible way to convert
           */
          URLEncoder olatUrlEncoder = new URLEncoder();
          String ceStr = contextEntry != null ? contextEntry.toString() : "NULL_ENTRY";
          ceStr = ceStr.replace(':', '/');
          ceStr = ceStr.replaceFirst("\\]", "/");
          ceStr= ceStr.replaceFirst("\\[", "");
          retVal = ceStr + retVal;
View Full Code Here

Examples of org.olat.core.commons.servlets.util.URLEncoder

          am.appendToUserNodeLog(node, coach, student, "FILE UPLOADED: " + folderEvent.getFilename());
          String toMail = student.getUser().getProperty(UserConstants.EMAIL, ureq.getLocale());
          Locale locale = I18nManager.getInstance().getLocaleOrDefault(student.getUser().getPreferences().getLanguage());
          Translator userTrsl = new PackageTranslator(PACKAGE, locale);
         
          String nodeUrl = new URLEncoder().encode("[" + OresHelper.calculateTypeName(CourseNode.class) + ":" + node.getIdent() + "]");
          String link = JumpInManager.getJumpInUri(this.getWindowControl().getBusinessControl()) + nodeUrl;
          log.debug("DEBUG : Returnbox notification email with link=" + link);
          MailTemplate mailTempl = new MailTemplate(userTrsl.translate("returnbox.email.subject"), userTrsl.translate(
              "returnbox.email.body", new String[] { userCourseEnv.getCourseEnvironment().getCourseTitle(), node.getShortTitle(),
                  folderEvent.getFilename(), link }), null) {
View Full Code Here

Examples of org.vietspider.chars.URLEncoder

  private static WebClient webClient = new WebClient();
 
  private static byte[] loadContent(String address) throws Exception {
    webClient.setURL(address, new URL(address));
    HttpGet httpGet = null;
    URLEncoder urlEncoder = new URLEncoder();
    address = urlEncoder.encode(address);
    httpGet = webClient.createGetMethod(address, "");

    if(httpGet == null) return null;
    HttpHost httpHost = webClient.createHttpHost(address);
    HttpResponse httpResponse = webClient.execute(httpHost, httpGet);
View Full Code Here

Examples of org.vietspider.chars.URLEncoder

//    methodHandler.setTimeout(30);
//  }
 
  public static byte[] loadContent(String address) throws Exception {
    try{
      URLEncoder urlEncoder = new URLEncoder();
      address = urlEncoder.encode(address);
     
      HttpResponse httpResponse = methodHandler.execute(address, "");
     
      HttpResponseReader httpResponseReader = HttpHandlers.getInstance().createReader();
      return httpResponseReader.readBody(httpResponse);
View Full Code Here

Examples of org.vietspider.chars.URLEncoder

    HttpGet httpGet = currentGets.remove(address);
    if(httpGet != null) httpGet.abort();
  }

  public byte[] loadContent(String referer, String address) throws Exception {
    URLEncoder urlEncoder = new URLEncoder();
   
    if(host == null) {
      setURL(referer, new URL(address));
    } else {
      URL url = new URL(address)
      URLCodeGenerator urlCodeUtil = new URLCodeGenerator();
      if(!urlCodeUtil.compareHost(url.getHost(), getHost())) {
        setURL(referer, new URL(address));
      }
    }

    HttpGet httpGet = null;
    try {
      address = urlEncoder.encode(address);
      httpGet = createGetMethod(address, referer);     
      currentGets.put(address, httpGet);

      if(httpGet == null) return null;
      HttpHost httpHost = createHttpHost(address);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.