Source Code Cross Referenced for TechnicalMetadata.java in  » ERP-CRM-Financial » sakai » org » theospi » portfolio » shared » model » 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 » ERP CRM Financial » sakai » org.theospi.portfolio.shared.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL:https://source.sakaiproject.org/svn/osp/trunk/common/api/src/java/org/theospi/portfolio/shared/model/TechnicalMetadata.java $
003:         * $Id:TechnicalMetadata.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2005, 2006 The Sakai Foundation.
007:         *
008:         * Licensed under the Educational Community License, Version 1.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         *
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         *
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.theospi.portfolio.shared.model;
021:
022:        import java.util.Date;
023:
024:        import org.sakaiproject.content.api.ContentResource;
025:        import org.sakaiproject.entity.api.EntityPropertyNotDefinedException;
026:        import org.sakaiproject.entity.api.EntityPropertyTypeException;
027:        import org.sakaiproject.metaobj.shared.model.Agent;
028:        import org.sakaiproject.metaobj.shared.model.Id;
029:        import org.sakaiproject.metaobj.shared.model.MimeType;
030:        import org.sakaiproject.metaobj.shared.model.Type;
031:        import org.sakaiproject.time.api.Time;
032:
033:        /**
034:         * Created by IntelliJ IDEA.
035:         * User: John Ellis
036:         * Date: Jul 27, 2005
037:         * Time: 6:09:44 PM
038:         * To change this template use File | Settings | File Templates.
039:         */
040:        public class TechnicalMetadata {
041:            private Id id;
042:            private Type type;
043:            private String name;
044:            private Date lastModified;
045:            private Date creation;
046:            private long size;
047:            private MimeType mimeType;
048:            private Agent owner;
049:
050:            public TechnicalMetadata(Id id, ContentResource resource,
051:                    Agent owner) {
052:                this .id = id;
053:                this .name = resource.getProperties().getProperty(
054:                        resource.getProperties().getNamePropDescription());
055:                this .size = resource.getContentLength();
056:                mimeType = new MimeType(resource.getContentType());
057:
058:                lastModified = getDate(resource, resource.getProperties()
059:                        .getNamePropModifiedDate());
060:                creation = getDate(resource, resource.getProperties()
061:                        .getNamePropCreationDate());
062:                this .owner = owner;
063:            }
064:
065:            protected Date getDate(ContentResource resource, String propName) {
066:                try {
067:                    Time time = resource.getProperties().getTimeProperty(
068:                            propName);
069:                    return new Date(time.getTime());
070:                } catch (EntityPropertyNotDefinedException e) {
071:                    return null;
072:                } catch (EntityPropertyTypeException e) {
073:                    throw new RuntimeException(e);
074:                }
075:            }
076:
077:            /**
078:             * @return Returns the creation.
079:             */
080:            public Date getCreation() {
081:                return creation;
082:            }
083:
084:            /**
085:             * @param creation The creation to set.
086:             */
087:            public void setCreation(Date creation) {
088:                this .creation = creation;
089:            }
090:
091:            /**
092:             * @return Returns the lastModified.
093:             */
094:            public Date getLastModified() {
095:                return lastModified;
096:            }
097:
098:            /**
099:             * @param lastModified The lastModified to set.
100:             */
101:            public void setLastModified(Date lastModified) {
102:                this .lastModified = lastModified;
103:            }
104:
105:            /**
106:             * @return Returns the mimeType.
107:             */
108:            public MimeType getMimeType() {
109:                return mimeType;
110:            }
111:
112:            /**
113:             * @param mimeType The mimeType to set.
114:             */
115:            public void setMimeType(MimeType mimeType) {
116:                this .mimeType = mimeType;
117:            }
118:
119:            /**
120:             * @return Returns the name.
121:             */
122:            public String getName() {
123:                return name;
124:            }
125:
126:            /**
127:             * @param name The name to set.
128:             */
129:            public void setName(String name) {
130:                this .name = name;
131:            }
132:
133:            /**
134:             * @return Returns the size.
135:             */
136:            public long getSize() {
137:                return size;
138:            }
139:
140:            /**
141:             * @param size The size to set.
142:             */
143:            public void setSize(long size) {
144:                this .size = size;
145:            }
146:
147:            /**
148:             * @return Returns the type.
149:             */
150:            public Type getType() {
151:                return type;
152:            }
153:
154:            /**
155:             * @param type The type to set.
156:             */
157:            public void setType(Type type) {
158:                this .type = type;
159:            }
160:
161:            public Id getId() {
162:                return id;
163:            }
164:
165:            public void setId(Id id) {
166:                this .id = id;
167:            }
168:
169:            public Agent getOwner() {
170:                return owner;
171:            }
172:
173:            public void setOwner(Agent owner) {
174:                this.owner = owner;
175:            }
176:
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.