Package freenet.clients.http

Examples of freenet.clients.http.HTTPRequestImpl


      if(logMINOR) Logger.minor(this, "Failed to parse URI: "+e1);
      throw new CommentException(l10n("couldNotParseURIWithError", "error", e1.getMessage()));
    }
    String path = uri.getPath();
   
    HTTPRequest req = new HTTPRequestImpl(uri, "GET");
    if (path != null) {
      if (path.equals("/") && req.isParameterSet("newbookmark") && !forBaseHref) {
        // allow links to the root to add bookmarks
        String bookmark_key = req.getParam("newbookmark");
        String bookmark_desc = req.getParam("desc");
        String bookmark_activelink = req.getParam("hasAnActivelink", "");

        try {
          FreenetURI furi = new FreenetURI(bookmark_key);
          bookmark_key = furi.toString();
          bookmark_desc = URLEncoder.encode(bookmark_desc, "UTF-8");
View Full Code Here


  }

  private String processURI(FreenetURI furi, URI uri, String overrideType, boolean noRelative, boolean inline) {
    // Valid Freenet URI, allow it
    // Now what about the queries?
    HTTPRequest req = new HTTPRequestImpl(uri, "GET");
    if(cb != null) cb.foundURI(furi);
    if(cb != null) cb.foundURI(furi, inline);
    return finishProcess(req, overrideType, '/' + furi.toString(false, false), uri, noRelative);
  }
View Full Code Here

  public void testBookmarkingExistingPost() throws URISyntaxException {
    /* create mocks. */
    Core core = mock(Core.class);
    WebInterface webInterface = mock(WebInterface.class);
    when(webInterface.getCore()).thenReturn(core);
    HTTPRequest httpRequest = new HTTPRequestImpl(new URI("/ajax/bookmark.ajax?post=abc"), "GET");
    FreenetRequest request = mock(FreenetRequest.class);
    when(request.getHttpRequest()).thenReturn(httpRequest);

    /* create JSON page. */
    BookmarkAjaxPage bookmarkAjaxPage = new BookmarkAjaxPage(webInterface);
View Full Code Here

  public void testBookmarkingMissingPost() throws URISyntaxException {
    /* create mocks. */
    Core core = mock(Core.class);
    WebInterface webInterface = mock(WebInterface.class);
    when(webInterface.getCore()).thenReturn(core);
    HTTPRequest httpRequest = new HTTPRequestImpl(new URI("/ajax/bookmark.ajax"), "GET");
    FreenetRequest request = mock(FreenetRequest.class);
    when(request.getHttpRequest()).thenReturn(httpRequest);

    /* create JSON page. */
    BookmarkAjaxPage bookmarkAjaxPage = new BookmarkAjaxPage(webInterface);
View Full Code Here

TOP

Related Classes of freenet.clients.http.HTTPRequestImpl

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.