public class Util
extends java.lang.Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
encodeBitstreamName(java.lang.String stringIn)
Version of encodeBitstreamName with one parameter, uses default encoding
|
static java.lang.String |
encodeBitstreamName(java.lang.String stringIn,
java.lang.String encoding)
Encode a bitstream name for inclusion in a URL in an HTML document.
|
static java.lang.String |
formatFileSize(double in)
Formats the file size.
|
static boolean |
getBoolParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String param)
Obtain a parameter from the given request as a boolean.
|
static java.util.List<java.lang.String> |
getControlledVocabulariesDisplayValueLocalized(Item item,
DCValue[] values,
java.lang.String schema,
java.lang.String element,
java.lang.String qualifier,
java.util.Locale locale)
Get a list of all the respective "displayed-value(s)" from the given
"stored-value(s)" for a specific metadata field of a DSpace Item, by
reading input-forms.xml
|
static int |
getIntParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String param)
Obtain a parameter from the given request as an int.
|
static int[] |
getIntParameters(javax.servlet.http.HttpServletRequest request,
java.lang.String param)
Obtain an array of int parameters from the given request as an int.
|
static java.lang.String |
getSourceVersion()
Gets Maven version string of the source that built this instance.
|
static java.lang.String |
getSubmitButton(javax.servlet.http.HttpServletRequest request,
java.lang.String def)
Get the button the user pressed on a submitted form.
|
static java.lang.String |
nonBreakSpace(java.lang.String s)
Utility method to convert spaces in a string to HTML non-break space
elements.
|
public static java.lang.String nonBreakSpace(java.lang.String s)
s - string to change spaces inpublic static java.lang.String encodeBitstreamName(java.lang.String stringIn,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
If the link to a bitstream is generated with the pathname separators escaped (e.g. "%2F" instead of "/") then the Web user agent perceives it to be one pathname element, and relative URI paths within that document containing ".." elements will be handled incorrectly.
stringIn - input string to encodeencoding - character encoding, e.g. UTF-8java.io.UnsupportedEncodingExceptionpublic static java.lang.String encodeBitstreamName(java.lang.String stringIn)
throws java.io.UnsupportedEncodingException
stringIn - input string to encodejava.io.UnsupportedEncodingExceptionpublic static java.lang.String formatFileSize(double in)
in - The number to convertpublic static int getIntParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String param)
-1 is
returned if the parameter is garbled or does not exist.request - the HTTP requestparam - the name of the parameterpublic static int[] getIntParameters(javax.servlet.http.HttpServletRequest request,
java.lang.String param)
-1 is returned in
array locations if that particular value is garbled.request - the HTTP requestparam - the name of the parameterpublic static boolean getBoolParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String param)
false is returned if the parameter is garbled or does not
exist.request - the HTTP requestparam - the name of the parameterpublic static java.lang.String getSubmitButton(javax.servlet.http.HttpServletRequest request,
java.lang.String def)
submit for this to work. A default
should be supplied, since often the browser will submit a form with no
submit button pressed if the user presses enter.request - the HTTP requestdef - the default buttonpublic static java.lang.String getSourceVersion()
public static java.util.List<java.lang.String> getControlledVocabulariesDisplayValueLocalized(Item item, DCValue[] values, java.lang.String schema, java.lang.String element, java.lang.String qualifier, java.util.Locale locale) throws java.sql.SQLException, DCInputsReaderException
item - The Dspace Itemvalues - A DCValue[] array of the specific "stored-value(s)"schema - A String with the schema name of the metadata fieldelement - A String with the element name of the metadata fieldqualifier - A String with the qualifier name of the metadata fieldjava.sql.SQLExceptionDCInputsReaderExceptionCopyright © 2018 DuraSpace. All Rights Reserved.