Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
208 naveen 1
/**
2
 * 
3
 */
4
package in.shop2020.creation.util;
5
 
6
import java.io.Serializable;
242 naveen 7
import java.io.UnsupportedEncodingException;
8
import java.net.URLEncoder;
208 naveen 9
 
10
/**
11
 * @author naveen
12
 *
13
 */
14
public class Media implements Serializable {
15
	/**
16
	 * 
17
	 */
18
	private static final long serialVersionUID = 1L;
19
	private String label;
20
	private String type;
21
	private String fileName;
22
	private String contentType;
23
	private String location;
24
 
25
	/**
26
	 * 
27
	 * @param label
28
	 * @param type
29
	 * @param location
30
	 */
31
	public Media(String label, String type, String location) {
32
		this.label = label;
33
		this.type = type;
34
		this.location = location;
35
	}
36
 
37
	/**
38
	 * @param label the label to set
39
	 */
40
	public void setLabel(String label) {
41
		this.label = label;
42
	}
43
	/**
44
	 * @return the label
45
	 */
46
	public String getLabel() {
47
		return label;
48
	}
49
	/**
242 naveen 50
	 * @return the label
51
	 */
52
	public String getEncodedLabel() {
53
		try {
54
			return URLEncoder.encode(label, "UTF-8");
55
		} catch (UnsupportedEncodingException e) {
56
			CreationUtils.getStackTrace(e);
57
			return "";
58
		}
59
	}
60
	/**
208 naveen 61
	 * @param type the type to set
62
	 */
63
	public void setType(String type) {
64
		this.type = type;
65
	}
66
	/**
67
	 * @return the type
68
	 */
69
	public String getType() {
70
		return type;
71
	}
72
	/**
73
	 * @param location the location to set
74
	 */
75
	public void setLocation(String location) {
76
		this.location = location;
77
	}
78
	/**
79
	 * @return the location
80
	 */
81
	public String getLocation() {
82
		return location;
83
	}
84
 
85
	/**
86
	 * @param fileName the fileName to set
87
	 */
88
	public void setFileName(String fileName) {
89
		this.fileName = fileName;
90
	}
91
 
92
	/**
93
	 * @return the fileName
94
	 */
95
	public String getFileName() {
96
		return fileName;
97
	}
98
 
99
	/**
100
	 * @param contentType the contentType to set
101
	 */
102
	public void setContentType(String contentType) {
103
		this.contentType = contentType;
104
	}
105
 
106
	/**
107
	 * @return the contentType
108
	 */
109
	public String getContentType() {
110
		return contentType;
111
	}
112
 
113
	/* (non-Javadoc)
114
	 * @see java.lang.Object#toString()
115
	 */
116
	@Override
117
	public String toString() {
118
		return "Media [label=" + label + ", location=" + location + ", type="
119
				+ type + "]";
120
	}
121
}