protected static String unescapeEntities(String input ) { if ( input == null ){ return( null ); } return( Entities.HTML40.unescape( input )); }
public void setCommentsFromHTML(String comments) { if(comments != null) { comments = removeHTMLTags(comments); comments = Entities.HTML40.unescape(comments); comments = comments.replaceAll(",", ""); comments = comments.replaceAll(" ", ""); try{ this.comments = Integer.parseInt(comments); }catch( Throwable e ){ //e.printStackTrace(); } } }
public void setCategoryFromHTML(String category) { if(category != null) { category = removeHTMLTags(category); this.category = Entities.HTML40.unescape(category).trim(); /*int separator = this.category.indexOf(">"); if(separator != -1) { this.category = this.category.substring(separator+1).trim(); }*/ if ( contentType == null || contentType.length() == 0 ){ contentType = guessContentTypeFromCategory( this.category ); } } }
public void setNbPeersFromHTML(String nbPeers) { if(nbPeers != null) { nbPeers = removeHTMLTags(nbPeers); String nbPeersS = Entities.HTML40.unescape(nbPeers); nbPeersS = nbPeersS.replaceAll(",", ""); nbPeersS = nbPeersS.replaceAll(" ", ""); try { this.nbPeers = Integer.parseInt(nbPeersS); } catch(Throwable e) { //this.nbPeers = 0; //e.printStackTrace(); } } }
public void setNbSeedsFromHTML(String nbSeeds) { if(nbSeeds != null) { nbSeeds = removeHTMLTags(nbSeeds); String nbSeedsS = Entities.HTML40.unescape(nbSeeds); nbSeedsS = nbSeedsS.replaceAll(",", ""); nbSeedsS = nbSeedsS.replaceAll(" ", ""); try { this.nbSeeds = Integer.parseInt(nbSeedsS); } catch(Throwable e) { //this.nbSeeds = 0; //e.printStackTrace(); } } }
public void setNbSuperSeedsFromHTML(String nbSuperSeeds) { if(nbSuperSeeds != null) { nbSuperSeeds = removeHTMLTags(nbSuperSeeds); String nbSuperSeedsS = Entities.HTML40.unescape(nbSuperSeeds); nbSuperSeedsS = nbSuperSeedsS.replaceAll(",", ""); nbSuperSeedsS = nbSuperSeedsS.replaceAll(" ", ""); try { this.nbSuperSeeds = Integer.parseInt(nbSuperSeedsS); } catch(Throwable e) { //this.nbSeeds = 0; //e.printStackTrace(); } } }
public void setPublishedDateFromHTML(String publishedDate) { if(publishedDate != null && publishedDate.length() > 0) { publishedDate = removeHTMLTags(publishedDate); String publishedDateS = Entities.HTML40.unescape(publishedDate).replace((char)160,(char)32); this.publishedDate = dateParser.parseDate(publishedDateS); } }
public void setVotesFromHTML(String votes_str) { if(votes_str != null) { votes_str = removeHTMLTags(votes_str); votes_str = Entities.HTML40.unescape(votes_str); votes_str = votes_str.replaceAll(",", ""); votes_str = votes_str.replaceAll(" ", ""); try { this.votes = Integer.parseInt(votes_str); } catch(Throwable e) { //e.printStackTrace(); } } }
public void setVotesDownFromHTML(String votes_str) { if(votes_str != null) { votes_str = removeHTMLTags(votes_str); votes_str = Entities.HTML40.unescape(votes_str); votes_str = votes_str.replaceAll(",", ""); votes_str = votes_str.replaceAll(" ", ""); try { this.votesDown = Integer.parseInt(votes_str); } catch(Throwable e) { //e.printStackTrace(); } } }
protected static final String unescapeEntities( String input ) { if ( input == null ){ return( null ); } return( Entities.HTML40.unescape( input )); }
public void setCategoryFromHTML(String category) { if(category != null) { category = removeHTMLTags(category); this.category = Entities.HTML40.unescape(category).trim(); /*int separator = this.category.indexOf(">"); if(separator != -1) { this.category = this.category.substring(separator+1).trim(); }*/ } }
public void setPublishedDateFromHTML(String publishedDate) { if(publishedDate != null) { publishedDate = removeHTMLTags(publishedDate); String publishedDateS = Entities.HTML40.unescape(publishedDate).replace((char)160,(char)32); this.publishedDate = dateParser.parseDate(publishedDateS); } }
public void setNameFromHTML(String name) { if(name != null) { name = removeHTMLTags(name); this.name = Entities.HTML40.unescape(name); } }