001: /******************************************************************************
002: * JBoss, a division of Red Hat *
003: * Copyright 2006, Red Hat Middleware, LLC, and individual *
004: * contributors as indicated by the @authors tag. See the *
005: * copyright.txt in the distribution for a full listing of *
006: * individual contributors. *
007: * *
008: * This is free software; you can redistribute it and/or modify it *
009: * under the terms of the GNU Lesser General Public License as *
010: * published by the Free Software Foundation; either version 2.1 of *
011: * the License, or (at your option) any later version. *
012: * *
013: * This software is distributed in the hope that it will be useful, *
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
016: * Lesser General Public License for more details. *
017: * *
018: * You should have received a copy of the GNU Lesser General Public *
019: * License along with this software; if not, write to the Free *
020: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
021: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
022: ******************************************************************************/package org.jboss.portal.cms.workflow;
023:
024: import java.io.Serializable;
025: import java.text.Format;
026: import java.text.SimpleDateFormat;
027: import java.util.Date;
028:
029: /**
030: * Created on : Dec 20, 2006
031: *
032: * @author Sohil Shah - sohil.shah@jboss.com
033: */
034: public class Content implements Serializable {
035:
036: private String path = null;
037: private String userName = null;
038: private String mimeType = null;
039: private int size = 0;
040: private Date creationDate = null;
041:
042: private String processId = null;
043:
044: /**
045: *
046: *
047: */
048: public Content() {
049:
050: }
051:
052: /** @return the path */
053: public String getPath() {
054: return path;
055: }
056:
057: /** @param path the path to set */
058: public void setPath(String path) {
059: this .path = path;
060: }
061:
062: /** @return the userName */
063: public String getUserName() {
064: return userName;
065: }
066:
067: /** @param userName the userName to set */
068: public void setUserName(String userName) {
069: this .userName = userName;
070: }
071:
072: /** @return the mimeType */
073: public String getMimeType() {
074: return mimeType;
075: }
076:
077: /** @param mimeType the mimeType to set */
078: public void setMimeType(String mimeType) {
079: this .mimeType = mimeType;
080: }
081:
082: /** @return the size */
083: public int getSize() {
084: return size;
085: }
086:
087: /** @param size the size to set */
088: public void setSize(int size) {
089: this .size = size;
090: }
091:
092: public String getSizeStr() {
093: return String.valueOf((this .size / 1024)) + "kb";
094: }
095:
096: /** @return the creationDate */
097: public Date getCreationDate() {
098: return creationDate;
099: }
100:
101: /** @param creationDate the creationDate to set */
102: public void setCreationDate(Date creationDate) {
103: this .creationDate = creationDate;
104: }
105:
106: public String getCreationDateStr() {
107: String date = "";
108: if (this .creationDate != null) {
109: Format formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
110: date = formatter.format(this .creationDate);
111: }
112: return date;
113: }
114:
115: /** @return */
116: public String getProcessId() {
117: return processId;
118: }
119:
120: /** @param processId */
121: public void setProcessId(String processId) {
122: this.processId = processId;
123: }
124: }
|