com.tle.common.scripting.types
Interface ResponseScriptType
Declaration: public interface ResponseScriptType

 

Used as the return results from ConnectionScriptType, which in-turn is retrieved by UtilsScriptObject.getConnection(String)

 

 

Methods Summary
abstract BinaryDataScriptType getAsBinaryData()
    
For retrieving binary data such as images
abstract java.lang.String getAsText()
    
abstract XmlScriptType getAsXml()
    
Get the data from the response in XML format This method will throw an exception if the returned text is not valid XML.
abstract int getCode()
    
abstract java.lang.String getContentType()
    
abstract XmlScriptType getHtmlAsXml()
    
Get the HTML data from the response and tidy it to be valid XML.
abstract boolean isError()
    

 

 

 

 

isError

 

public abstract boolean isError( )

 

Returns:
The response from the external site is an error code, or there was a problem connecting to the server.

 

 

 

getCode

 

public abstract int getCode( )

 

Returns:
The response code from the external site

 

 

 

getContentType

 

public abstract java.lang.String getContentType( )

 

Returns:
The MIME type as returned in the Content-Type header from the external site

 

 

 

getAsText

 

public abstract java.lang.String getAsText( )

 

Returns:
Get the data from the response in plain text format

 

 

 

getAsXml

 

public abstract XmlScriptType getAsXml( )

 

Get the data from the response in XML format This method will throw an exception if the returned text is not valid XML.

 

Returns:
An XmlScriptType object representing the data in the response.

 

 

 

getHtmlAsXml

 

public abstract XmlScriptType getHtmlAsXml( )

 

Get the HTML data from the response and tidy it to be valid XML. This method will throw an exception if the returned text could not be tidied into valid XML.

 

Returns:
An XmlScriptType object representing the data in the response.

 

 

 

getAsBinaryData

 

public abstract BinaryDataScriptType getAsBinaryData( )

 

For retrieving binary data such as images

 

Returns:
A BinaryDataScriptType object