Examples of FeedInfo


Examples of com.commafeed.frontend.model.FeedInfo

    }
    return Response.ok(writer.toString()).build();
  }

  private FeedInfo fetchFeedInternal(String url) {
    FeedInfo info = null;
    url = StringUtils.trimToEmpty(url);
    url = prependHttp(url);
    try {
      FetchedFeed feed = feedFetcher.fetch(url, true, null, null, null, null);
      info = new FeedInfo();
      info.setUrl(feed.getUrlAfterRedirect());
      info.setTitle(feed.getTitle());

    } catch (Exception e) {
      log.debug(e.getMessage(), e);
      throw new WebApplicationException(e, Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build());
    }
View Full Code Here

Examples of com.commafeed.frontend.model.FeedInfo

  @ApiOperation(value = "Fetch a feed", notes = "Fetch a feed by its url", response = FeedInfo.class)
  public Response fetchFeed(@SecurityCheck User user, @ApiParam(value = "feed url", required = true) FeedInfoRequest req) {
    Preconditions.checkNotNull(req);
    Preconditions.checkNotNull(req.getUrl());

    FeedInfo info = null;
    try {
      info = fetchFeedInternal(req.getUrl());
    } catch (Exception e) {
      return Response.status(Status.INTERNAL_SERVER_ERROR).entity(Throwables.getStackTraceAsString(Throwables.getRootCause(e)))
          .build();
View Full Code Here

Examples of com.commafeed.frontend.model.FeedInfo

      FeedCategory category = null;
      if (req.getCategoryId() != null && !CategoryREST.ALL.equals(req.getCategoryId())) {
        category = feedCategoryDAO.findById(Long.valueOf(req.getCategoryId()));
      }
      FeedInfo info = fetchFeedInternal(url);
      feedSubscriptionService.subscribe(user, info.getUrl(), req.getTitle(), category);
    } catch (Exception e) {
      log.error("Failed to subscribe to URL {}: {}", url, e.getMessage(), e);
      return Response.status(Status.SERVICE_UNAVAILABLE).entity("Failed to subscribe to URL " + url + ": " + e.getMessage()).build();
    }
    return Response.ok().build();
View Full Code Here

Examples of com.commafeed.frontend.model.FeedInfo

      Preconditions.checkNotNull(url);

      url = prependHttp(url);
      url = fetchFeedInternal(url).getUrl();

      FeedInfo info = fetchFeedInternal(url);
      feedSubscriptionService.subscribe(user, info.getUrl(), info.getTitle(), null);
    } catch (Exception e) {
      log.info("Could not subscribe to url {} : {}", url, e.getMessage());
    }
    return Response.temporaryRedirect(URI.create(config.getApplicationSettings().getPublicUrl())).build();
  }
View Full Code Here

Examples of com.google.feedserver.metadata.FeedInfo

    if (!"gviz".equalsIgnoreCase(out)) {
      return super.retrieveFeed(request);
    }
   
    FeedInfo feedInfo = getFeedInfo(request);
    if (feedInfo == null) {
      throw new FeedServerAdapterException(Reason.ADAPTER_CONFIGURATION_NOT_CORRECT,
      "Missing feed info in configuration");
    }
    Feed dataFeed = super.retrieveFeed(request);
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.