Esri Geoportal Server
1.0

com.esri.gpt.framework.http
Class ContentBase

java.lang.Object
  extended by com.esri.gpt.framework.http.ContentBase
Direct Known Subclasses:
ContentHandler, ContentProvider

public abstract class ContentBase
extends Object

Base class for providers of HTTP request content and handlers of HTTP response content.


Constructor Summary
ContentBase()
          Default constructor.
 
Method Summary
 long executeIO(InputStream source, OutputStream destination)
          Executes stream to stream I/O.
 long executeIO(Reader source, Writer destination)
          Executes character to character I/O.
 int getInitialBufferlength()
          Gets the initial buffer length (in bytes) for streamed content.
 String getLoggableContent()
          Gets content associated with the HTTP request/response suitable for logging.
 void setInitialBufferLength(int length)
          Sets the initial buffer length (in bytes) for streamed content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentBase

public ContentBase()
Default constructor.

Method Detail

getInitialBufferlength

public int getInitialBufferlength()
Gets the initial buffer length (in bytes) for streamed content.
Default = 4096 bytes

Returns:
the initial buffer length (in bytes)

setInitialBufferLength

public void setInitialBufferLength(int length)
Sets the initial buffer length (in bytes) for streamed content.
Default = 4096 bytes

Parameters:
length - the initial buffer length (in bytes)

getLoggableContent

public String getLoggableContent()
Gets content associated with the HTTP request/response suitable for logging.
The default implementation returns null.

Returns:
the loggable string (null if not applicable)

executeIO

public long executeIO(InputStream source,
                      OutputStream destination)
               throws IOException
Executes stream to stream I/O.

Parameters:
source - the input stream from which data will be read
destination - the output stream to which data will be written
Returns:
the number of bytes transferred
Throws:
IOException - if an exception occurs

executeIO

public long executeIO(Reader source,
                      Writer destination)
               throws IOException
Executes character to character I/O.

Parameters:
source - the character reader from which data will be read
destination - the character writer the to which data will be written
Returns:
the number of characters transferred
Throws:
IOException - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.