Source Code Cross Referenced for EmailPart.java in  » Chat » claros-intouch » org » claros » commons » mail » models » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Chat » claros intouch » org.claros.commons.mail.models 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.claros.commons.mail.models;
002:
003:        import javax.activation.DataSource;
004:
005:        import org.claros.commons.mail.utility.Utility;
006:
007:        /**
008:         * @author Umut Gokbayrak
009:         */
010:        public class EmailPart {
011:            private int id;
012:            private Object content;
013:            private String disposition;
014:            private String contentType;
015:            private String contentId;
016:            private long size;
017:            private String sizeReadable;
018:            private String filename;
019:            private String shortname;
020:            private DataSource dataSource;
021:
022:            public EmailPart() {
023:                super ();
024:            }
025:
026:            public int getId() {
027:                return id;
028:            }
029:
030:            public void setId(int id) {
031:                this .id = id;
032:            }
033:
034:            public Object getContent() {
035:                return content;
036:            }
037:
038:            public void setContent(Object content) {
039:                this .content = content;
040:            }
041:
042:            public String getDisposition() {
043:                return disposition;
044:            }
045:
046:            public void setDisposition(String disposition) {
047:                this .disposition = disposition;
048:            }
049:
050:            public String getContentType() {
051:                return contentType;
052:            }
053:
054:            public void setContentType(String contentType) {
055:                this .contentType = contentType;
056:            }
057:
058:            public String getContentId() {
059:                return contentId;
060:            }
061:
062:            public void setContentId(String contentId) {
063:                this .contentId = contentId;
064:            }
065:
066:            public long getSize() {
067:                return size;
068:            }
069:
070:            public void setSize(long size) {
071:                this .size = size;
072:                this .sizeReadable = Utility.sizeToHumanReadable(size);
073:            }
074:
075:            /**
076:             * @return
077:             */
078:            public String getFileName() {
079:                return filename;
080:            }
081:
082:            /**
083:             * @param string
084:             */
085:            public void setFileName(String string) {
086:                filename = string;
087:
088:                if (filename == null) {
089:                    if (getContentType().indexOf("text/html") >= 0) {
090:                        filename = "Html Body";
091:                    } else if (getContentType().indexOf("text/plain") >= 0) {
092:                        filename = "Text Body";
093:                    } else {
094:                        filename = "Body";
095:                    }
096:                }
097:                if (filename.length() > 9) {
098:                    shortname = filename.substring(0, 9) + "...";
099:                } else {
100:                    shortname = filename;
101:                }
102:            }
103:
104:            public boolean isPlainText() {
105:                if (this .contentType != null
106:                        && this .contentType.indexOf("text/plain") >= 0) {
107:                    return true;
108:                }
109:                return false;
110:            }
111:
112:            public boolean isHTMLText() {
113:                if (this .contentType != null
114:                        && this .contentType.indexOf("text/html") >= 0) {
115:                    return true;
116:                }
117:                return false;
118:            }
119:
120:            public boolean isImage() {
121:                if (this .contentType != null
122:                        && this .contentType.indexOf("image/") >= 0) {
123:                    return true;
124:                }
125:                return false;
126:            }
127:
128:            public boolean isAudio() {
129:                if (this .contentType != null
130:                        && this .contentType.indexOf("audio/") >= 0) {
131:                    return true;
132:                }
133:                return false;
134:            }
135:
136:            /**
137:             * @return
138:             */
139:            public String getSizeReadable() {
140:                return sizeReadable;
141:            }
142:
143:            /**
144:             * @param string
145:             */
146:            public void setSizeReadable(String string) {
147:                sizeReadable = string;
148:            }
149:
150:            /**
151:             * @return
152:             */
153:            public String getFilename() {
154:                return filename;
155:            }
156:
157:            /**
158:             * @param string
159:             */
160:            public void setFilename(String string) {
161:                filename = string;
162:            }
163:
164:            /**
165:             * @return
166:             */
167:            public String getShortname() {
168:                return shortname;
169:            }
170:
171:            /**
172:             * @param string
173:             */
174:            public void setShortname(String string) {
175:                shortname = string;
176:            }
177:
178:            /**
179:             * @return
180:             */
181:            public DataSource getDataSource() {
182:                return dataSource;
183:            }
184:
185:            /**
186:             * @param source
187:             */
188:            public void setDataSource(DataSource source) {
189:                dataSource = source;
190:            }
191:
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.