Rev 479 | Rev 580 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/****/package in.shop2020.metamodel.core;import in.shop2020.metamodel.util.MetaModelComponent;import java.io.UnsupportedEncodingException;import java.net.URLEncoder;import java.util.StringTokenizer;/*** @author naveen**/public class Media extends MetaModelComponent {/****/private static final long serialVersionUID = 1L;private String label;private String title;private String videoType;private String type;private String fileName;private String contentType;private String location;/**** @param label* @param type* @param location*/public Media(String label, String type, String location) {this.label = label;this.type = type;this.location = location;}/*** @param label the label to set*/public void setLabel(String label) {this.label = label;}/*** @return the label*/public String getLabel() {return label;}public void setTitle(String title) {this.title = title;}public String getTitle() {return title;}public void setVideoType(String videoType) {this.videoType = videoType;}public String getVideoType() {return videoType;}/*** @return the label*/public String getEncodedLabel() {try {return URLEncoder.encode(label, "UTF-8");} catch (UnsupportedEncodingException e) {//CreationUtils.getStackTrace(e);e.printStackTrace();return "";}}/*** @param type the type to set*/public void setType(String type) {this.type = type;}/*** @return the type*/public String getType() {return type;}/*** @param location the location to set*/public void setLocation(String location) {this.location = location;}/*** @return the location*/public String getLocation() {return location;}public String getYoutubeId(){StringTokenizer token = new StringTokenizer(location,"?v=");if(token.countTokens() == 2){token.nextToken();return token.nextToken();}return "";}/*** @param fileName the fileName to set*/public void setFileName(String fileName) {this.fileName = fileName;}/*** @return the fileName*/public String getFileName() {return fileName;}/*** @param contentType the contentType to set*/public void setContentType(String contentType) {this.contentType = contentType;}/*** @return the contentType*/public String getContentType() {return contentType;}/* (non-Javadoc)* @see java.lang.Object#toString()*/@Overridepublic String toString() {return "Media [label=" + label + ", location=" + location + ", type="+ type + "]";}}