de.jtec.beads.content
Class BinaryContent

java.lang.Object
  extended by de.jtec.beads.content.AbstractAttributeHolder
      extended by de.jtec.beads.content.Content
          extended by de.jtec.beads.content.PrimitiveContent
              extended by de.jtec.beads.content.BinaryContent
All Implemented Interfaces:
Attributed

public class BinaryContent
extends PrimitiveContent

binary content ehich will be served verbatim. it contains reference to file inside canvas and this can be only relative to canvas itself, it will be managed by canvas. typical creation scenarion in web context would be file resulting from upload and on temporary location. this file needs to be copied on save of bead. any changes of underlying binary content will become active only after saving through canvas

Author:
k.pribluda

Field Summary
(package private)  java.io.File file
           
(package private)  java.lang.String mimeType
           
 
Fields inherited from class de.jtec.beads.content.AbstractAttributeHolder
attributes
 
Constructor Summary
BinaryContent(java.lang.String mimeType, java.io.File file)
          create binary content with mime type and file containing content
BinaryContent(java.lang.String mimeType, java.lang.String file)
           
 
Method Summary
 java.io.File getFile()
          file assotiated with binary content.
 java.io.InputStream getInputStream()
          get input stream off containing assotiated content.
 java.lang.String getMimeType()
           
 void setFile(java.io.File file)
           
 void setMimeType(java.lang.String mimeType)
           
 
Methods inherited from class de.jtec.beads.content.AbstractAttributeHolder
getAttributes, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

transient java.io.File file

mimeType

java.lang.String mimeType
Constructor Detail

BinaryContent

public BinaryContent(java.lang.String mimeType,
                     java.io.File file)
create binary content with mime type and file containing content

Parameters:
mimeType -
file -

BinaryContent

public BinaryContent(java.lang.String mimeType,
                     java.lang.String file)
Method Detail

getFile

public java.io.File getFile()
file assotiated with binary content. this file can not be used for creation of input stream, as this will be relative to canvas root. use get

Returns:

getMimeType

public java.lang.String getMimeType()

setFile

public void setFile(java.io.File file)

setMimeType

public void setMimeType(java.lang.String mimeType)

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.FileNotFoundException
get input stream off containing assotiated content.

Returns:
Throws:
java.io.FileNotFoundException


Copyright © 2007 J-Tec-Team. All Rights Reserved.