|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.parameter.Parameter
com.sun.slamd.parameter.FileURLParameter
This class defines a parameter whose value specifies a file from which
clients may obtain data to use during processing. The file specified must
be accessible to all clients. If a client cannot access the specified file,
then an attempt to obtain its contents will result in an exception. Note
that a call to retrieve the information in the file will read the entire
contents of that file into memory, so it is best to keep the files small.
That should also be done if the files are to be retrieved from a remote
server because of the transfer involved.
The file specified in this parameter should actually be in the form of a URL.
The URL may be either a file URL that points to a file on the local or
network-attached filesystem (e.g., "file:///tmp/file.txt" would refer to the
file "/tmp/file.txt"), or may be an HTTP URL that points to a
publicly-readable file on a Web server (via HTTP -- not HTTPS).
| Field Summary | |
static int |
URL_TYPE_FILE
The URL type that indicates the file will be retrieved from the local filesystem. |
static int |
URL_TYPE_FTP
The URL type that indicates the file will be retrieved from a remote server over FTP. |
static int |
URL_TYPE_HTTP
The URL type that indicates the file will be retrieved from a remote server over HTTP. |
static int |
URL_TYPE_HTTPS
The URL type that indicates the file will be retrieved from a remote server over HTTPS. |
static int |
URL_TYPE_NONE
The URL type that indicates that no URL was provided. |
| Fields inherited from class com.sun.slamd.parameter.Parameter |
description, displayName, isRequired, name, value |
| Constructor Summary | |
FileURLParameter()
Creates a new instance of the Parameter to be used when decoding values transported over the network, and should not be used by jobs to create parameters. |
|
FileURLParameter(java.lang.String name)
Creates a new file parameter with the specified name. |
|
FileURLParameter(java.lang.String name,
boolean isRequired)
Creates a new file parameter with the specified name and required/optional indicator. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName)
Creates a new file parameter with the specified name and display name. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName,
boolean isRequired)
Creates a new file parameter with the specified name, display name, and required/optional indicator. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
boolean isRequired,
java.lang.String urlString)
Creates a new file URL parameter with the specified information. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.net.URL fileURL)
Creates a new file parameter with the specified name, display name, description, and file URL. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.net.URL fileURL,
boolean isRequired)
Creates a new file parameter with the specified name, display name, description and file URL, and required/optional indicator. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.net.URL fileURL)
Creates a new file parameter with the specified name, display name, and file URL. |
|
FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.net.URL fileURL,
boolean isRequired)
Creates a new file parameter with the specified name, display name, file URL, and required/optional indicator. |
|
| Method Summary | |
java.lang.Object |
clone()
Creates a clone of this parameter. |
java.lang.String |
getDisplayValue()
Retrieves the value of the parameter in a form that may be displayed to the end user. |
java.lang.String[] |
getFileLines()
Retrieves the contents of the file as an array of strings corresponding to the lines in the file. |
java.net.URL |
getFileURL()
Retrieves the URL associated with this file parameter. |
java.lang.String |
getHTMLDisplayValue()
Retrieves the value of the parameter in a form that may be displayed to the end user as part of an HTML document. |
java.lang.String |
getHTMLInputForm(java.lang.String prefix)
Retrieves a string of text that can be used to request a value for this parameter using an HTML form. |
java.io.InputStream |
getInputStream()
Retrieves an input stream that allows the caller to get access to the information in the file. |
java.lang.String |
getInvalidReason(java.lang.Object value)
Retrieves the reason that the specified value is not acceptable for use with this parameter. |
java.lang.String[] |
getNonBlankFileLines()
Retrieves the contents of the file as an array of strings corresponding to the lines in the file, with blank lines omitted. |
byte[] |
getRawFileData()
Retrieves the contents of the file as an array of the bytes contained in that file. |
java.lang.Object |
getValue()
Retrieves the file URL associated with this parameter. |
java.lang.String |
getValueString()
Retrieves the value of this parameter in text form. |
int |
getVisibleColumns()
Retrieves the number of columns that should be visible in the HTML input form. |
void |
htmlInputFormToValue(java.lang.String[] values)
Specifies the value of this parameter based on the provided text that would be returned from posting an HTML form. |
void |
setValue(java.lang.Object value)
Specifies the value to use for this parameter. |
void |
setValueFrom(Parameter parameter)
Sets the value for this parameter from the information in the provided parameter. |
void |
setValueFromString(java.lang.String valueString)
Specifies the value to use for this parameter from the provided String. |
void |
setVisibleColumns(int visibleColumns)
Specifies the number of columns that should be visible in the HTML input form. |
| Methods inherited from class com.sun.slamd.parameter.Parameter |
decode, encode, getDescription, getDisplayName, getHTMLPostValue, getInvalidReason, getName, hasValue, isRequired, isValid, isValid, setDescription, setDisplayName, setName, setRequired, toString |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int URL_TYPE_NONE
public static final int URL_TYPE_FILE
public static final int URL_TYPE_HTTP
public static final int URL_TYPE_HTTPS
public static final int URL_TYPE_FTP
| Constructor Detail |
public FileURLParameter()
setName, setDisplayName,
setDescription, or setValueFromString, then it
should be done here.
public FileURLParameter(java.lang.String name)
name - The name to use for this parameter.
public FileURLParameter(java.lang.String name,
boolean isRequired)
name - The name to use for this parameter.isRequired - Indicates whether this parameter is required to have a
value.
public FileURLParameter(java.lang.String name,
java.lang.String displayName)
name - The name to use for this parameter.displayName - The display name to use for this parameter.
public FileURLParameter(java.lang.String name,
java.lang.String displayName,
boolean isRequired)
name - The name to use for this parameter.displayName - The display name to use for this parameter.isRequired - Indicates whether this parameter is required to have a
value.
public FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.net.URL fileURL)
name - The name to use for this parameter.displayName - The display name to use for this parameter.fileURL - The URL specifying the location and access method for
the file to use for this parameter.
public FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.net.URL fileURL,
boolean isRequired)
name - The name to use for this parameter.displayName - The display name to use for this parameter.fileURL - The URL specifying the location and access method for
the file to use for this parameter.isRequired - Indicates whether this parameter is required to have a
value.
public FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.net.URL fileURL)
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.fileURL - The URL specifying the location and access method for
the file to use for this parameter.
public FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.net.URL fileURL,
boolean isRequired)
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.fileURL - The URL specifying the location and access method for
the file to use for this parameter.isRequired - Indicates whether this parameter is required to have a
value.
public FileURLParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
boolean isRequired,
java.lang.String urlString)
throws InvalidValueException
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.isRequired - Indicates whether this parameter is required to have a
value.urlString - The string representation of the URL specifying the
location and access method for the file to use for
this parameter.
InvalidValueException - If the provided URL string does not contain
a valid or supported URL.| Method Detail |
public java.net.URL getFileURL()
java.net.URL
object does not have any way of dealing with authentication data.
public java.lang.String[] getFileLines()
throws java.io.IOException,
SLAMDException
java.io.IOException - If a problem occurs while attempting to access the
information in the specified file.
SLAMDException - If a problem is encountered while parsing the file
URL to retrieve the appropriate information from
it.
public java.lang.String[] getNonBlankFileLines()
throws java.io.IOException,
SLAMDException
java.io.IOException - If a problem occurs while attempting to access the
information in the specified file.
SLAMDException - If a problem is encountered while parsing the file
URL to retrieve the appropriate information from
it.
public byte[] getRawFileData()
throws java.io.IOException,
SLAMDException
java.io.IOException - If a problem occurs while attempting to access the
information in the specified file.
SLAMDException - If a problem is encountered while parsing the file
URL to retrieve the appropriate information from
it.
public java.io.InputStream getInputStream()
throws java.io.IOException,
SLAMDException
java.io.IOException - If a problem occurs while opening the input stream.
SLAMDException - If a problem is encountered while parsing the file
URL to retrieve the appropriate information from
it.public java.lang.Object getValue()
getValue in class Parameter
public void setValue(java.lang.Object value)
throws InvalidValueException
setValue in class Parametervalue - The value to use for this parameter.
InvalidValueException - If the provided value is not acceptable for
use with this parameter.public void setValueFrom(Parameter parameter)
setValueFrom in class Parameterparameter - The parameter from which to take the value for this
parameter.public java.lang.String getValueString()
getValueString in class Parameter
public void setValueFromString(java.lang.String valueString)
throws InvalidValueException
setValueFromString in class ParametervalueString - The string representation of the value to use for this
parameter.
InvalidValueException - If the provided value cannot be used to
provide a value for this parameter.public java.lang.String getInvalidReason(java.lang.Object value)
getInvalidReason in class Parametervalue - The value for which to make the determination.
null if it is acceptable.public java.lang.String getDisplayValue()
getDisplayValue in class Parameterpublic java.lang.String getHTMLDisplayValue()
getHTMLDisplayValue in class Parameterpublic int getVisibleColumns()
public void setVisibleColumns(int visibleColumns)
visibleColumns - The number of columns that should be visible in the
HTML input form.public java.lang.String getHTMLInputForm(java.lang.String prefix)
getHTMLInputForm in class Parameterprefix - The prefix that should be placed in front of the parameter
name as the name of the form element.
public void htmlInputFormToValue(java.lang.String[] values)
throws InvalidValueException
htmlInputFormToValue in class Parametervalues - The set of values for this parameter contained in the
servlet request.
InvalidValueException - If the specified value is not acceptable
for this parameter.public java.lang.Object clone()
clone in class Parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||