@Deprecated public class HtmlResponse extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PN_CHANGE_LOG
Deprecated.
human readable changelog
|
static String |
PN_ERROR
Deprecated.
The Throwable caught while processing the request.
|
static String |
PN_IS_CREATED
Deprecated.
Indicating whether request processing created new data.
|
static String |
PN_LOCATION
Deprecated.
externally mapped location url of the modified path
|
static String |
PN_PARENT_LOCATION
Deprecated.
externally mapped location url of the parent of the modified path
|
static String |
PN_PATH
Deprecated.
the path of the modified item.
|
static String |
PN_REFERER
Deprecated.
the referrer of the request
|
static String |
PN_STATUS_CODE
Deprecated.
status code.
|
static String |
PN_STATUS_MESSAGE
Deprecated.
some human readable status message
|
static String |
PN_TITLE
Deprecated.
some human readable title like: 200 Created /foo/bar
|
Constructor and Description |
---|
HtmlResponse()
Deprecated.
Creates a new html response with default settings, which is
null for almost all properties except the
isCreateRequest() which defaults to false . |
Modifier and Type | Method and Description |
---|---|
Throwable |
getError()
Deprecated.
Returns any recorded error or
null |
String |
getLocation()
Deprecated.
Returns the location of the modification.
|
String |
getParentLocation()
Deprecated.
Returns the parent location of the modification.
|
String |
getPath()
Deprecated.
Returns the absolute path of the item upon which the request operated.
|
Object |
getProperty(String name)
Deprecated.
Returns the generic response property with the given name and type or
null if no such property exists. |
<Type> Type |
getProperty(String name,
Class<Type> type)
Deprecated.
Returns the generic response property with the given name and type or
null if no such property exists or the property is not of
the requested type. |
String |
getReferer()
Deprecated.
Returns the referer as from the 'referer' request header.
|
int |
getStatusCode()
Deprecated.
Returns the status code of this instance.
|
String |
getStatusMessage()
Deprecated.
|
boolean |
isCreateRequest()
Deprecated.
Returns
true if this was a create request. |
boolean |
isSuccessful()
Deprecated.
|
void |
onChange(String type,
String... arguments)
Deprecated.
Records a generic change of the given
type . |
void |
onCopied(String srcPath,
String dstPath)
Deprecated.
Records a 'copied' change.
|
void |
onCreated(String path)
Deprecated.
Records a 'created' change
|
void |
onDeleted(String path)
Deprecated.
Records a 'deleted' change
|
void |
onModified(String path)
Deprecated.
Records a 'modified' change
|
void |
onMoved(String srcPath,
String dstPath)
Deprecated.
Records a 'moved' change.
|
void |
send(javax.servlet.http.HttpServletResponse response,
boolean setStatus)
Deprecated.
Writes the response to the given writer and replaces all ${var} patterns
by the value of the respective property.
|
void |
setCreateRequest(boolean isCreateRequest)
Deprecated.
Sets whether the request was a create request or not.
|
void |
setError(Throwable error)
Deprecated.
|
void |
setLocation(String location)
Deprecated.
|
void |
setParentLocation(String parentLocation)
Deprecated.
|
void |
setPath(String path)
Deprecated.
Sets the absolute path of the item upon which the request operated.
|
void |
setProperty(String name,
Object value)
Deprecated.
Sets a generic response property with the given
|
void |
setReferer(String referer)
Deprecated.
Sets the referer property
|
void |
setStatus(int code,
String message)
Deprecated.
sets the response status code properties
|
void |
setTitle(String title)
Deprecated.
Sets the title of the response message
|
public static final String PN_TITLE
public static final String PN_STATUS_CODE
public static final String PN_STATUS_MESSAGE
public static final String PN_LOCATION
public static final String PN_PARENT_LOCATION
public static final String PN_PATH
public static final String PN_REFERER
public static final String PN_IS_CREATED
false
and may be changed by calling
the setCreateRequest(boolean)
method.public static final String PN_CHANGE_LOG
public static final String PN_ERROR
setError(Throwable)
method is called.public HtmlResponse()
null
for almost all properties except the
isCreateRequest()
which defaults to false
.public String getReferer()
public void setReferer(String referer)
public String getPath()
If the setPath(String)
method has not been called yet, this
method returns null
.
public void setPath(String path)
public boolean isCreateRequest()
true
if this was a create request.
Before calling the setCreateRequest(boolean)
method, this method
always returns false
.
public void setCreateRequest(boolean isCreateRequest)
public String getLocation()
public void setLocation(String location)
public String getParentLocation()
public void setParentLocation(String parentLocation)
public void setTitle(String title)
title
- the titlepublic void setStatus(int code, String message)
code
- the codemessage
- the messagepublic int getStatusCode()
setStatus(int, String)
method, the
status code is determined by checking if there was an error. If there
was an error, the response is assumed to be unsuccessful and 500 is returned.
If there is no error, the response is assumed to be successful and 200 is returned.public String getStatusMessage()
public Throwable getError()
null
null
public void setError(Throwable error)
public boolean isSuccessful()
public void onModified(String path)
path
- path of the item that was modifiedpublic void onCreated(String path)
path
- path of the item that was createdpublic void onDeleted(String path)
path
- path of the item that was deletedpublic void onMoved(String srcPath, String dstPath)
srcPath
- source path of the node that was moveddstPath
- destination path of the node that was moved.public void onCopied(String srcPath, String dstPath)
srcPath
- source path of the node that was copieddstPath
- destination path of the node that was copied.public void onChange(String type, String... arguments)
type
.
The change is added to the internal list of changes with the syntax of a
method call, where the type
is the method name and the
arguments
are the string arguments to the method enclosed in
double quotes. For example, the the call
onChange("sameple", "arg1", "arg2");is aded as
sample("arg1", "arg2")to the internal list of changes.
type
- The type of the modificationarguments
- The arguments to the modificationspublic void setProperty(String name, Object value)
name
- name of the propertyvalue
- value of the propertypublic <Type> Type getProperty(String name, Class<Type> type)
null
if no such property exists or the property is not of
the requested type.public Object getProperty(String name)
null
if no such property exists.public void send(javax.servlet.http.HttpServletResponse response, boolean setStatus) throws IOException
response
- to send tosetStatus
- whether to set the status code on the responseIOException
- if an i/o exception occursCopyright © 2014 The Apache Software Foundation. All rights reserved.