info.informatica.doc
Class DocumentFile

java.lang.Object
  extended by info.informatica.doc.DocumentFile
All Implemented Interfaces:
Document
Direct Known Subclasses:
Maildoc, TextDocument

public abstract class DocumentFile
extends Object
implements Document

Abstract class with the basic operations to obtain information about a document.

Version:
1.01
Author:
amengual at informatica dot info

Constructor Summary
DocumentFile()
           
 
Method Summary
abstract  InputStream getInputStream()
          Gets an InputStream with the contents of this document.
 Date getLastUpdateDate()
          devuelve la fecha
 String getMediaType()
          devuelve el tipo IMT
abstract  String getMetaInfo(String metaname)
          Gets the meta-information corresponding to metaname.
 int getSize()
          Gets the size of the document.
 String getTitle()
          Gets the title of the document.
abstract  void load(InputStream is)
          Loads the content of the document with the given Inputstream.
 void setDate(Date date)
          Especifica la fecha de la pagina
 void setSize(int sz)
          Especifica el tamaņo
 void setTitle(String title)
          Sets the title of the document.
 void setType(String type)
          Especifica el tipo IMT del documento
abstract  void write(OutputStream os)
          Writes the contents of this document to the given OutputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentFile

public DocumentFile()
Method Detail

setTitle

public void setTitle(String title)
Sets the title of the document.

Specified by:
setTitle in interface Document
Parameters:
title - the title of the document

getTitle

public String getTitle()
Gets the title of the document.

Specified by:
getTitle in interface Document
Returns:
the title of the document.

setType

public void setType(String type)
Especifica el tipo IMT del documento

Parameters:
type - el tipo IMT

getMediaType

public String getMediaType()
devuelve el tipo IMT

Specified by:
getMediaType in interface Document
Returns:
el tipo IMT

setDate

public void setDate(Date date)
Especifica la fecha de la pagina

Parameters:
date - la fecha

getLastUpdateDate

public Date getLastUpdateDate()
devuelve la fecha

Specified by:
getLastUpdateDate in interface Document
Returns:
la fecha

setSize

public void setSize(int sz)
Especifica el tamaņo

Parameters:
sz - el tamaņo

getSize

public int getSize()
Gets the size of the document.

Returns:
the size of the document, or -1 if was unable to determine it.

getMetaInfo

public abstract String getMetaInfo(String metaname)
Gets the meta-information corresponding to metaname.

Parameters:
metaname - the name of the meta-information
Returns:
the meta-information, or null if there is no meta-information.

load

public abstract void load(InputStream is)
                   throws IOException
Loads the content of the document with the given Inputstream.

Parameters:
is - InputStream object with the contents of the document
Throws:
IOException

getInputStream

public abstract InputStream getInputStream()
                                    throws IOException
Gets an InputStream with the contents of this document.

Returns:
an InputStream with the contents of this document
Throws:
IOException

write

public abstract void write(OutputStream os)
                    throws IOException
Writes the contents of this document to the given OutputStream.

Parameters:
os - the OutputStream to write the document
Throws:
IOException