1 package org.apache.slide.projector.value; 2 3 import java.io.ByteArrayInputStream ; 4 import java.io.IOException ; 5 import java.io.InputStream ; 6 import java.util.Date ; 7 8 public class DateValue extends ObjectValue { 9 public final static String CONTENT_TYPE = "application/projector-date"; 10 11 public DateValue(Date date) { 12 super(date); 13 } 14 15 public Date getDate() { 16 return (Date )getObject(); 17 } 18 19 public InputStream getInputStream() throws IOException { 20 return new ByteArrayInputStream (((String )getObject()).getBytes("UTF-8")); 21 } 22 23 public String toString() { 24 return String.valueOf(getObject()); 25 } 26 27 public String getContentType() { 28 return CONTENT_TYPE; 29 } 30 } | Popular Tags |