• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Person类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gdata.data.Person的典型用法代码示例。如果您正苦于以下问题:Java Person类的具体用法?Java Person怎么用?Java Person使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Person类属于com.google.gdata.data包,在下文中一共展示了Person类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeUpdatingComment

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Creates a comment that updates an existing issue.
 */
protected IssueCommentsEntry makeUpdatingComment() {
  Person author = new Person();
  author.setName(username);

  // Create issue updates
  Updates updates = new Updates();
  updates.setSummary(new Summary("New issue summary"));
  updates.setStatus(new Status("Accepted"));
  updates.setOwnerUpdate(new OwnerUpdate(username));
  updates.addLabel(new Label("-Priority-High"));
  updates.addLabel(new Label("Priority-Low"));
  updates.addLabel(new Label("-Milestone-2009"));
  updates.addLabel(new Label("Milestone-2010"));
  updates.addLabel(new Label("Type-Enhancement"));
  updates.addCcUpdate(new CcUpdate("-" + username));

  // Create issue comment entry
  IssueCommentsEntry entry = new IssueCommentsEntry();
  entry.getAuthors().add(author);
  entry.setContent(new HtmlTextConstruct("some comment"));
  entry.setUpdates(updates);
  entry.setSendEmail(new SendEmail("False"));

  return entry;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:29,代码来源:ProjectHostingWriteDemo.java


示例2: makeClosingComment

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Creates a comment that closes an issue by setting Status to "Fixed".
 */
protected IssueCommentsEntry makeClosingComment() {
  Person author = new Person();
  author.setName(username);

  // Set the Status as Fixed
  Updates updates = new Updates();
  updates.setStatus(new Status("Fixed"));

  // Create issue comment entry
  IssueCommentsEntry entry = new IssueCommentsEntry();
  entry.getAuthors().add(author);
  entry.setContent(new HtmlTextConstruct("This was fixed last week."));
  entry.setUpdates(updates);
  entry.setSendEmail(new SendEmail("False"));

  return entry;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:21,代码来源:ProjectHostingWriteDemo.java


示例3: parseHCard

import com.google.gdata.data.Person; //导入依赖的package包/类
private void parseHCard(Element element, Person author) {
  NodeList nodeList = element.getChildNodes();
  for (int i = 0; i < nodeList.getLength(); i++) {
    Node node = nodeList.item(i);
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      Element child = (Element) node;
      if (hasClass(child, "fn")) {
        author.setName(child.getTextContent());
        String href = child.getAttribute("href");
        if (href.startsWith("mailto:") && (author.getEmail() == null)) {
          author.setEmail(href.substring(7));
        }
      } else if (hasClass(child, "n")) {
        author.setName(child.getTextContent());
      } else if (hasClass(child, "email")) {
        author.setEmail(child.getTextContent());
      } else {
        parseHCard(child, author);
      }
    }
  }
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:23,代码来源:AuthorParserImpl.java


示例4: Recipe

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Creates a recipe out of a GoogleBaseEntry.
 * 
 * @param entry an entry that represents a recipe
 */
public Recipe(GoogleBaseEntry entry) {
  id = extractIdFromUrl(entry.getId());
  title = entry.getTitle().getPlainText();
  url = entry.getHtmlLink().getHref();
  String description = null;
  if (entry.getContent() != null) {
    Content content = entry.getContent();
    if (content instanceof TextContent) {
      description = ((TextContent)content).getContent().getPlainText();
    } else if (content instanceof OtherContent) {
      description = ((OtherContent)content).getText();
    }
  }
  this.description = description;
  mainIngredient = new HashSet<String>(entry.getGoogleBaseAttributes().
      getTextAttributeValues(MAIN_INGREDIENT_ATTRIBUTE));
  cuisine = new HashSet<String>(entry.getGoogleBaseAttributes().
      getTextAttributeValues(CUISINE_ATTRIBUTE));
  cookingTime = entry.getGoogleBaseAttributes().
      getIntUnitAttribute(COOKING_TIME_ATTRIBUTE);
  postedOn = entry.getPublished();

  // if an entry has no author specified, will set it to empty string
  List<Person> authors = entry.getAuthors();
  postedBy = (authors.isEmpty() ? AUTHOR_UNKNOWN : authors.get(0).getName());
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:32,代码来源:Recipe.java


示例5: makeNewIssue

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Creates a new issue that can be inserted to the issues feed.
 */
protected IssuesEntry makeNewIssue() {
  Person author = new Person();
  author.setName(username);

  Owner owner = new Owner();
  owner.setUsername(new Username(username));

  Cc cc = new Cc();
  cc.setUsername(new Username(username));

  IssuesEntry entry = new IssuesEntry();
  entry.getAuthors().add(author);

  // Uncomment the following line to set the owner along with issue creation.
  // It's intentionally commented out so we can demonstrate setting the owner
  // field using setOwnerUpdate() as shown in makeUpdatingComment() below.
  // entry.setOwner(owner);

  entry.setContent(new HtmlTextConstruct("issue description"));
  entry.setTitle(new PlainTextConstruct("issue summary"));
  entry.setStatus(new Status("New"));
  entry.addLabel(new Label("Priority-High"));
  entry.addLabel(new Label("Milestone-2009"));
  entry.addCc(cc);
  entry.setSendEmail(new SendEmail("False"));

  return entry;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:32,代码来源:ProjectHostingWriteDemo.java


示例6: makePlainComment

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Creates a comment without any updates.
 */
protected IssueCommentsEntry makePlainComment() {
  Person author = new Person();
  author.setName(username);

  // Create issue comment entry
  IssueCommentsEntry entry = new IssueCommentsEntry();
  entry.getAuthors().add(author);
  entry.setContent(new HtmlTextConstruct("Some comment"));
  entry.setSendEmail(new SendEmail("False"));

  return entry;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:16,代码来源:ProjectHostingWriteDemo.java


示例7: getModifyingUser

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * @return the user who modified the document/created the revision
 */
public Person getModifyingUser() {
  if (getAuthors().size() > 0) {
    return getAuthors().get(0);
  }
  return null;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:10,代码来源:RevisionEntry.java


示例8: declareExtensions

import com.google.gdata.data.Person; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void declareExtensions(ExtensionProfile extProfile) {
  declare(extProfile, GphotoId.getDefaultDescription(false, false));
  declare(extProfile, GphotoType.getDefaultDescription(false, false));
  extProfile.declareArbitraryXmlExtension(extClass);

  // Declare that the person extension point can have user, nick, or thumb.
  extProfile.declare(Person.class,
      GphotoUsername.getDefaultDescription(false, false));
  extProfile.declare(Person.class,
      GphotoNickname.getDefaultDescription(false, false));
  extProfile.declare(Person.class,
      GphotoThumbnail.getDefaultDescription(false, false));
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:15,代码来源:GphotoDataImpl.java


示例9: parseAuthor

import com.google.gdata.data.Person; //导入依赖的package包/类
@Override
public Person parseAuthor(Element element) {
  checkNotNull(element);
  Person author = new Person();
  parseElement(element, author);
  return author;
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:8,代码来源:AuthorParserImpl.java


示例10: parseElement

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Parses the given element and populates the given Person object accordingly.
 */
private void parseElement(Element element, Person author) {
  NodeList nodeList = element.getChildNodes();
  for (int i = 0; i < nodeList.getLength(); i++) {
    Node node = nodeList.item(i);
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      Element child = (Element) node;
      if (hasClass(child, "vcard")) {
        parseHCard(child, author);
      } else {
        parseElement(child, author);
      }
    }
  }
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:18,代码来源:AuthorParserImpl.java


示例11: testUnusualStructure

import com.google.gdata.data.Person; //导入依赖的package包/类
@Test
public void testUnusualStructure() {
  final Element entryElement = document.createElement("div");
  entryElement.setAttribute("class", "hentry announcementspage");
  final Element row = document.createElement("tr");
  final Element cell = document.createElement("td");
  final Element authorElement = document.createElement("span");
  authorElement.setAttribute("class", "vcard");
  cell.appendChild(authorElement);
  row.appendChild(cell);
  final Element contentElement = document.createElement("td");
  contentElement.setAttribute("class", "entry-content");
  row.appendChild(contentElement);
  entryElement.appendChild(document.createElement("table").appendChild(row));
  final Element titleElement = document.createElement("h3");
  titleElement.setAttribute("class", "entry-title");
  entryElement.appendChild(document.createElement("b")
      .appendChild(document.createElement("i").appendChild(titleElement)));
  
  final Person author = context.mock(Person.class);
  final Content content = context.mock(Content.class);
  final TextConstruct title = context.mock(TextConstruct.class);
  
  context.checking(new Expectations() {{
    oneOf (authorParser).parseAuthor(authorElement); 
      will(returnValue(author));
    oneOf (contentParser).parseContent(contentElement);
      will(returnValue(content));
    oneOf (titleParser).parseTitle(titleElement);
      will(returnValue(title));
  }});
  
  BaseContentEntry<?> entry = entryParser.parseEntry(entryElement);
  assertTrue(EntryType.getType(entry) == EntryType.ANNOUNCEMENTS_PAGE);
  assertEquals(author, entry.getAuthors().get(0));
  assertEquals(content, entry.getContent());
  assertEquals(title, entry.getTitle());
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:39,代码来源:EntryParserImplTest.java


示例12: testGetAuthorElement

import com.google.gdata.data.Person; //导入依赖的package包/类
@Test
public void testGetAuthorElement() {
  Person author = new Person();
  author.setName("Ben Simon");
  author.setEmail("[email protected]");
  BaseContentEntry<?> entry = new WebPageEntry();
  entry.getAuthors().add(author);
  XmlElement element = RendererUtils.getAuthorElement(entry);
  assertEquals("<span class=\"author\"><span class=\"vcard\"><a class=\"fn\" href=\"" +
  		"mailto:[email protected]\">Ben Simon</a></span></span>", element.toString());
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:12,代码来源:RendererUtilsTest.java


示例13: YoutubeAccount

import com.google.gdata.data.Person; //导入依赖的package包/类
public YoutubeAccount(Person user) {

        if (user == null)
            return;

        //Id
        setId(Sources.YOUTUBE + "#" + user.getName());
        //The name of the user
        username = user.getName();
        source = Sources.YOUTUBE;
        //The link to the user's profile
        pageUrl = user.getUri();
    }
 
开发者ID:MKLab-ITI,项目名称:simmo,代码行数:14,代码来源:YoutubeAccount.java


示例14: YoutubeStreamUser

import com.google.gdata.data.Person; //导入依赖的package包/类
public YoutubeStreamUser(Person user) {
	super(SocialNetworkSource.Youtube.toString(), Operation.NEW);
	if (user == null) return;
	
	//Id
	id = SocialNetworkSource.Youtube+"#"+user.getName();
	//The id of the user in the network
	userid = user.getName();
	//The name of the user
	username = user.getName();
	//streamId
	streamId = SocialNetworkSource.Youtube.toString();
	//The link to the user's profile
	linkToProfile = user.getUri();
}
 
开发者ID:socialsensor,项目名称:socialmedia-abstractions,代码行数:16,代码来源:YoutubeStreamUser.java


示例15: createPost

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Creates a new post on a blog. The new post can be stored as a draft or
 * published based on the value of the isDraft paramter. The method creates an
 * Entry for the new post using the title, content, authorName and isDraft
 * parameters. Then it uses the given GoogleService to insert the new post. If
 * the insertion is successful, the added post will be returned.
 * 
 * @param myService An authenticated GoogleService object.
 * @param title Text for the title of the post to create.
 * @param content Text for the content of the post to create.
 * @param authorName Display name of the author of the post.
 * @param userName username of the author of the post.
 * @param isDraft True to save the post as a draft, False to publish the post.
 * @return An Entry containing the newly-created post.
 * @throws ServiceException If the service is unable to handle the request.
 * @throws IOException If the URL is malformed.
 */
public static Entry createPost(BloggerService myService, String title,
    String content, String authorName, String userName, Boolean isDraft)
    throws ServiceException, IOException {
  // Create the entry to insert
  Entry myEntry = new Entry();
  myEntry.setTitle(new PlainTextConstruct(title));
  myEntry.setContent(new PlainTextConstruct(content));
  Person author = new Person(authorName, null, userName);
  myEntry.getAuthors().add(author);
  myEntry.setDraft(isDraft);

  // Ask the service to insert the new entry
  URL postUrl = new URL(feedUri + POSTS_FEED_URI_SUFFIX);
  return myService.insert(postUrl, myEntry);
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:33,代码来源:BloggerClient.java


示例16: printComment

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Prints a comment entry in human-readable format.
 *
 * @param entry comment entry to print
 */
protected void printComment(IssueCommentsEntry entry) {
  System.out.println(DIVIDER);
  if (entry.getId() != null) {
    String commentId = getCommentId(entry.getId());
    System.out.printf("Comment #%s:\t%s\n", commentId, entry.getId());
  } else {
    System.out.println("Comment");
  }

  Person author = entry.getAuthors().get(0);
  printPerson("Author", author.getName(), author.getUri());

  TextContent textContent = (TextContent) entry.getContent();
  if ((textContent != null) && (textContent.getContent() != null)) {
    HtmlTextConstruct textConstruct =
        (HtmlTextConstruct) textContent.getContent();
    System.out.println("\tComment\n\t\t" + textConstruct.getHtml());
  }

  if (entry.hasUpdates()) {
    Updates updates = entry.getUpdates();

    if (updates.hasSummary()) {
      System.out.println("\tSummary\n\t\t" + updates.getSummary().getValue());
    }

    if (updates.hasStatus()) {
      System.out.println("\tStatus\n\t\t" + updates.getStatus().getValue());
    }

    if (updates.hasOwnerUpdate()) {
      System.out.println(
          "\tOwner\n\t\t" + updates.getOwnerUpdate().getValue());
    }

    if (updates.getLabels().size() > 0) {
      System.out.println("\tLabel");
      for (Label label : updates.getLabels()) {
        System.out.println("\t\t" + label.getValue());
      }
    }

    if (updates.getCcUpdates().size() > 0) {
      System.out.println("\tCC");
      for (CcUpdate cc : updates.getCcUpdates()) {
        System.out.println("\t\t" + cc.getValue());
      }
    }

    if (updates.getBlockedOnUpdates().size() > 0) {
      System.out.println("\tBlockedOnUpdate");
      for (BlockedOnUpdate blockedOnUpdate : updates.getBlockedOnUpdates()) {
        System.out.println("\t\t" + blockedOnUpdate.getValue());
      }
    }

    if (updates.hasMergedIntoUpdate()) {
      System.out.println(
          "\tMergedIntoUpdate\n\t\t" +
          updates.getMergedIntoUpdate().getValue());
    }
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:69,代码来源:ProjectHostingClient.java


示例17: main

import com.google.gdata.data.Person; //导入依赖的package包/类
/**
 * Main entry point.  Parses arguments and creates and invokes the
 * IndexClient.
 */
public static void main(String[] args) throws Exception {

  SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
  String username = parser.getValue("username", "user", "u");
  String password = parser.getValue("password", "pass", "passwd", "pw", "p");
  boolean help = parser.containsKey("help", "h");
  if (help || (username == null) || (password == null)) {
    usage();
    System.exit(1);
  }

  boolean author = parser.containsKey("author", "a");
  boolean columns = parser.containsKey("headers", "header", "h");
  boolean worksheets = parser.containsKey("worksheets", "worksheet", "w");

  IndexClient client = new IndexClient(username, password);

  for (SpreadsheetEntry spreadsheet : client.getSpreadsheetEntries()) {
    
    System.out.print(spreadsheet.getTitle().getPlainText());
    if (author) {
      for (Person person : spreadsheet.getAuthors()) {
        System.out.println(" - " + person.getName());
      }
    } else {
      System.out.println();
    }  //authors (or not)

    if (worksheets || columns) {
      List<WorksheetEntry> entries = client.getWorksheetEntries(spreadsheet);
      for (WorksheetEntry worksheet : entries) {
        System.out.println("\t" + worksheet.getTitle().getPlainText());

        if (columns) {
          List<String> headers = client.getColumnHeaders(worksheet);
          for (String header : headers) {
            System.out.println("\t\t" + header);
          }
        }  // columns

      }
    }  // worksheets

  }  // spreadsheets
  
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:51,代码来源:IndexClient.java


示例18: testNormalPage

import com.google.gdata.data.Person; //导入依赖的package包/类
@Test
public void testNormalPage() {
  final Element entryElement = document.createElement("div");
  entryElement.setAttribute("class", "hentry webpage");
  entryElement.setAttribute("id", "http://identification");
  final Element authorElement = document.createElement("span");
  authorElement.setAttribute("class", "vcard");
  entryElement.appendChild(authorElement);
  final Element contentElement = document.createElement("div");
  contentElement.setAttribute("class", "entry-content");
  entryElement.appendChild(contentElement);
  final Element summaryElement = document.createElement("p");
  summaryElement.setAttribute("class", "summary");
  entryElement.appendChild(summaryElement);
  final Element titleElement = document.createElement("h3");
  titleElement.setAttribute("class", "entry-title");
  entryElement.appendChild(titleElement);
  final Element updatedElement = document.createElement("abbr");
  updatedElement.setAttribute("class", "updated");
  entryElement.appendChild(updatedElement);  
  
  final Person author = context.mock(Person.class);
  final Content content = context.mock(Content.class);
  final TextConstruct summary = context.mock(TextConstruct.class, "summary");
  final TextConstruct title = context.mock(TextConstruct.class, "title");
  final DateTime updated = DateTime.parseDateTime("2009-07-30T15:48:23.975Z");
  
  context.checking(new Expectations() {{
    oneOf (authorParser).parseAuthor(authorElement); 
      will(returnValue(author));
    oneOf (contentParser).parseContent(contentElement);
      will(returnValue(content));
    oneOf (summaryParser).parseSummary(summaryElement);
      will(returnValue(summary));
    oneOf (titleParser).parseTitle(titleElement);
      will(returnValue(title));
    oneOf (updatedParser).parseUpdated(updatedElement);
      will(returnValue(updated));
  }});
  
  BaseContentEntry<?> entry = entryParser.parseEntry(entryElement);
  assertEquals("http://identification", entry.getId());
  assertTrue(EntryType.getType(entry) == EntryType.WEB_PAGE);
  assertEquals(author, entry.getAuthors().get(0));
  assertEquals(content, entry.getContent());
  assertEquals(title, entry.getTitle());
  assertEquals(updated, entry.getUpdated());
}
 
开发者ID:sih4sing5hong5,项目名称:google-sites-liberation,代码行数:49,代码来源:EntryParserImplTest.java


示例19: convertVideos

import com.google.gdata.data.Person; //导入依赖的package包/类
private List<YouTubeVideo> convertVideos(List<VideoEntry> videos) {

      List<YouTubeVideo> youtubeVideosList = new LinkedList<YouTubeVideo>();
      int duration;
      boolean isRelated;
      for (VideoEntry videoEntry : videos) {
      	
      	YouTubeMediaGroup mediaGroup = videoEntry.getMediaGroup();
      	
      	try{
      	duration = mediaGroup.getYouTubeContents().get(0).getDuration();
      	}
      	catch(Exception e){
      		duration=0;
      	}
      	isRelated = true;//checkContext(videoEntry.getTitle().getPlainText(), mediaGroup.getDescription().getPlainTextContent());
      	if(duration <= 300 && isRelated==true){
           YouTubeVideo ytv = new YouTubeVideo();
           String personName="";
           for(Person p: videoEntry.getAuthors()){
           	personName+=p.getName();
           	break;
           }
           
           String webPlayerUrl = mediaGroup.getPlayer().getUrl();
           ytv.setWebPlayerUrl(webPlayerUrl);
  
           ytv.setDuration( duration );
           ytv.setDescription(mediaGroup.getDescription().getPlainTextContent());
           ytv.setVideoOwner(personName);
           
           String query = "?v=";
           int index = webPlayerUrl.indexOf(query);
	
           String embeddedWebPlayerUrl = webPlayerUrl.substring(index+query.length());
           embeddedWebPlayerUrl = YOUTUBE_EMBEDDED_URL + embeddedWebPlayerUrl;
           ytv.setEmbeddedWebPlayerUrl(embeddedWebPlayerUrl);
  
           List<String> thumbnails = new LinkedList<String>();
           for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) {
               thumbnails.add(mediaThumbnail.getUrl());
           }   
           ytv.setThumbnails(thumbnails);
           
           List<YouTubeMedia> medias = new LinkedList<YouTubeMedia>();
           for (YouTubeMediaContent mediaContent : mediaGroup.getYouTubeContents()) {
               medias.add(new YouTubeMedia(mediaContent.getUrl(), mediaContent.getType()));
           }
           ytv.setMedias(medias);
           ytv.setTitle(videoEntry.getTitle().getPlainText());
           //ytv.setDescription(videoEntry.getTextContent().getContent().getPlainText());
           
           String[] idParts = videoEntry.getId().split(":");
           
           ytv.setVideoId(idParts[idParts.length-1]);
           youtubeVideosList.add(ytv);
          
      	}
 
      }

      return youtubeVideosList;

  }
 
开发者ID:hamdikavak,项目名称:youtube-search-tool,代码行数:65,代码来源:YouTubeManager.java


示例20: convertEntries

import com.google.gdata.data.Person; //导入依赖的package包/类
private List<YouTubeVideo> convertEntries(List<VideoEntry> videoEntries) {

    List<YouTubeVideo> youtubeVideosList = new ArrayList<YouTubeVideo>();
    int duration, qIndex;
    String personName="", query = "?v=", webPlayerUrl, embeddedWebPlayerUrl;
    List<String> thumbnails;
    List<YouTubeMedia> medias;
    String[] idParts;
    
    for (VideoEntry videoEntry : videoEntries) {
    	
    	YouTubeMediaGroup mediaGroup = videoEntry.getMediaGroup();
    	
    	try{
    		duration = mediaGroup.getYouTubeContents().get(0).getDuration();
    	}
    	catch(Exception e){
    		duration=0;
    	}
    	//isRelated = true;//checkContext(videoEntry.getTitle().getPlainText(), mediaGroup.getDescription().getPlainTextContent());
         
     YouTubeVideo ytv = new YouTubeVideo();
  personName="";
  
  for(Person p: videoEntry.getAuthors()){
  	personName += p.getName();
          break;
  }
         
  webPlayerUrl = mediaGroup.getPlayer().getUrl();
  ytv.setWebPlayerUrl(webPlayerUrl);
 
  ytv.setDuration( duration );
  ytv.setDescription(mediaGroup.getDescription().getPlainTextContent());
  ytv.setVideoOwner(personName);
          
  qIndex = webPlayerUrl.indexOf(query);
 
 
  embeddedWebPlayerUrl = webPlayerUrl.substring(qIndex + query.length());
  embeddedWebPlayerUrl = YOUTUBE_EMBEDDED_URL + embeddedWebPlayerUrl;
  ytv.setEmbeddedWebPlayerUrl(embeddedWebPlayerUrl);

     thumbnails = new LinkedList<String>();

     for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) {
     	thumbnails.add(mediaThumbnail.getUrl());
     }   
     
     ytv.setThumbnails(thumbnails);
         
     medias = new LinkedList<YouTubeMedia>();
         
     for (YouTubeMediaContent mediaContent : mediaGroup.getYouTubeContents()) {
     	medias.add(new YouTubeMedia(mediaContent.getUrl(), mediaContent.getType()));
     }
     
     ytv.setMedias(medias);
     ytv.setTitle(videoEntry.getTitle().getPlainText());
     
     idParts = videoEntry.getId().split(":");
     
     ytv.setVideoId(idParts[idParts.length-1]);
     youtubeVideosList.add(ytv);
    }
  
    return youtubeVideosList;
  
}
 
开发者ID:hamdikavak,项目名称:youtube-search-tool,代码行数:70,代码来源:YouTubeSearchTool.java



注:本文中的com.google.gdata.data.Person类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContributionItemService类代码示例发布时间:2022-05-23
下一篇:
Java NodeClosedException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap