001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/web/tags/sakai_2-4-1/news-impl/impl/src/java/org/sakaiproject/news/impl/BasicNewsItemEnclosure.java $
003: * $Id: BasicNewsItemEnclosure.java 18368 2006-11-22 04:36:12Z joshua.ryan@asu.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 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.sakaiproject.news.impl;
021:
022: import org.sakaiproject.news.api.NewsItemEnclosure;
023:
024: /**
025: * <p>
026: * BasicNewsItemEnclosure is default implementation of the Interface for a Sakai News message enclsoures.
027: * </p>
028: * <p>
029: * The news message enclsure has header fields (type, size) and a url of the actual enclosed file. All fields are read only.
030: * </p>
031: *
032: * @author Joshua Ryan joshua.ryan@asu.edu alt^i
033: */
034: public class BasicNewsItemEnclosure implements NewsItemEnclosure {
035:
036: /** the url of the enclosure */
037: private String url;
038:
039: /** the type of the enclosure */
040: private String type;
041:
042: /** the length in Bytes of the enclosure */
043: private long length;
044:
045: /**
046: * Construct a BasicNewsItemEnclosure
047: *
048: * @param url
049: * @param type
050: * @param length
051: */
052: public BasicNewsItemEnclosure(String url, String type, long length) {
053: this .url = url;
054: this .type = type;
055: this .length = length;
056: }
057:
058: /**
059: * Access the length of the enclosure.
060: *
061: * @return The length of the enclosure.
062: */
063: public long getLength() {
064: return length;
065: }
066:
067: /**
068: * Access the type of the enclosure.
069: *
070: * @return The type of the enclosure.
071: */
072: public String getType() {
073: return type;
074: }
075:
076: /**
077: * Access the url of the enclosure.
078: *
079: * @return The url of the enclosure.
080: */
081: public String getUrl() {
082: return url;
083: }
084:
085: /**
086: * Set the type of the Enclosure.
087: *
088: * @param type
089: * The type of the Enclosure.
090: */
091: public void setType(String type) {
092: this .type = type;
093: }
094:
095: /**
096: * Set the url of the Enclosure.
097: *
098: * @param url
099: * The url of the Enclosure.
100: */
101: public void setUrl(String url) {
102: this .url = url;
103: }
104:
105: /**
106: * Set the length of the Enclosure in Bytes.
107: *
108: * @param length
109: * The length of the Enclosure in Bytes.
110: */
111: public void setLength(long length) {
112: this.length = length;
113: }
114:
115: }
|