net.ezcontent.document
Interface Attachment

All Known Implementing Classes:
Attachment

public interface Attachment

Representa un archivo que se anexa a un documento.

Author:
Enrique Zamudio

Method Summary
 byte[] getData()
           
 InputStream getDataAsStream()
           
 String getFilename()
           
 String getMimeType()
           
 String getName()
           
 void setData(byte[] buf)
          Los datos del archivo.
 void setDataFromStream(InputStream stream)
          Los datos del archivo, manejados como stream.
 void setFilename(String name)
          El nombre del archivo.
 void setMimeType(String type)
          El tipo MIME del archivo.
 void setName(String name)
          El nombre del anexo (es distinto al nombre del archivo).
 void writeToFile(File file)
          Escribe el contenido del archivo al archivo indicado.
 void writeToStream(OutputStream out)
          Escribe el contenido del archivo al stream indicado.
 

Method Detail

setName

public void setName(String name)
El nombre del anexo (es distinto al nombre del archivo). Se usa para que los documentos puedan obtener anexos refiriendose a ellos por su nombre.


getName

public String getName()

setFilename

public void setFilename(String name)
El nombre del archivo.


getFilename

public String getFilename()

setData

public void setData(byte[] buf)
Los datos del archivo.


getData

public byte[] getData()

setDataFromStream

public void setDataFromStream(InputStream stream)
                       throws IOException
Los datos del archivo, manejados como stream.

Throws:
IOException

getDataAsStream

public InputStream getDataAsStream()
                            throws IOException
Throws:
IOException

setMimeType

public void setMimeType(String type)
El tipo MIME del archivo.


getMimeType

public String getMimeType()

writeToStream

public void writeToStream(OutputStream out)
                   throws IOException
Escribe el contenido del archivo al stream indicado.

Throws:
IOException

writeToFile

public void writeToFile(File file)
                 throws IOException
Escribe el contenido del archivo al archivo indicado.

Throws:
IOException