org.mortbay.html

Class Include


public class Include
extends Element

Include File, InputStream or Reader Element.

This Element includes another file. This class expects that the HTTP directory separator '/' will be used. This will be converted to the local directory separator.

Version:
$Id: Include.java,v 1.6 2005/08/13 00:01:23 gregwilkins Exp $
Author:
Greg Wilkins
See Also:
Element

Field Summary

Fields inherited from class org.mortbay.html.Element

ALIGN, BGCOLOR, BOTTOM, CENTER, CLASS, COLOR, HEIGHT, ID, LEFT, MIDDLE, RIGHT, SIZE, STYLE, TOP, VALIGN, WIDTH, attributeMap, noAttributes

Constructor Summary

Include(File file)
Constructor.
Include(InputStream in)
Constructor.
Include(Reader in)
Constructor.
Include(String fileName)
Constructor.
Include(String directory, String fileName)
Constructor.
Include(URL url)
Constructor.

Method Summary

void
write(Writer out)
Write element to a Writer.

Methods inherited from class org.mortbay.html.Element

attribute, attribute, attribute, attributes, attributes, bgColor, bottom, center, color, cssClass, cssID, height, height, height, left, middle, right, setAttributesFrom, size, size, size, style, toString, top, width, width, width, write, write, write

Constructor Details

Include

public Include(File file)
            throws IOException
Constructor. Include file.
Parameters:
file - file

Include

public Include(InputStream in)
            throws IOException
Constructor. Include InputStream. Byte to character transformation is done assuming the default local character set. What this means is that on EBCDIC systems the included file is assumed to be in EBCDIC.
Parameters:
in - stream

Include

public Include(Reader in)
            throws IOException
Constructor. Include Reader.
Parameters:
in - reader

Include

public Include(String fileName)
            throws IOException
Constructor. Include file.
Parameters:
fileName - Filename

Include

public Include(String directory,
               String fileName)
            throws IOException
Constructor. Include file
Parameters:
directory - Directory name
fileName - file name

Include

public Include(URL url)
            throws IOException
Constructor. Include contents of a URL. Byte to character transformation is done assuming the default local character set. What this means is that on EBCDIC systems the included file is assumed to be in EBCDIC.
Parameters:
url - the URL to read from.

Method Details

write

public void write(Writer out)
            throws IOException
Write element to a Writer. This abstract method is called by the Page or other containing Element to write the HTML for this element. This must be implemented by the derived Element classes.
Overrides:
write in interface Element
Parameters:
out - Writer to write the element to.

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.