|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.app.util.Util
public class Util
Miscellaneous utility methods
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static String |
encodeBitstreamName(String stringIn)
Version of encodeBitstreamName with one parameter, uses default encoding |
static String |
encodeBitstreamName(String stringIn,
String encoding)
Encode a bitstream name for inclusion in a URL in an HTML document. |
static String |
formatFileSize(double in)
Formats the file size. |
static boolean |
getBoolParameter(javax.servlet.http.HttpServletRequest request,
String param)
Obtain a parameter from the given request as a boolean. |
static List<String> |
getControlledVocabulariesDisplayValueLocalized(Item item,
DCValue[] values,
String schema,
String element,
String qualifier,
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,
String param)
Obtain a parameter from the given request as an int. |
static int[] |
getIntParameters(javax.servlet.http.HttpServletRequest request,
String param)
Obtain an array of int parameters from the given request as an int. |
static String |
getSourceVersion()
Gets Maven version string of the source that built this instance. |
static String |
getSubmitButton(javax.servlet.http.HttpServletRequest request,
String def)
Get the button the user pressed on a submitted form. |
static String |
nonBreakSpace(String s)
Utility method to convert spaces in a string to HTML non-break space elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static String nonBreakSpace(String s)
s - string to change spaces in
public static String encodeBitstreamName(String stringIn,
String encoding)
throws 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-8
UnsupportedEncodingException
public static String encodeBitstreamName(String stringIn)
throws UnsupportedEncodingException
stringIn - input string to encode
UnsupportedEncodingExceptionpublic static String formatFileSize(double in)
in - The number to convert
public static int getIntParameter(javax.servlet.http.HttpServletRequest request,
String param)
-1 is
returned if the parameter is garbled or does not exist.
request - the HTTP requestparam - the name of the parameter
public static int[] getIntParameters(javax.servlet.http.HttpServletRequest request,
String param)
-1 is returned in
array locations if that particular value is garbled.
request - the HTTP requestparam - the name of the parameter
public static boolean getBoolParameter(javax.servlet.http.HttpServletRequest request,
String param)
false is returned if the parameter is garbled or does not
exist.
request - the HTTP requestparam - the name of the parameter
public static String getSubmitButton(javax.servlet.http.HttpServletRequest request,
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 button
public static String getSourceVersion()
public static List<String> getControlledVocabulariesDisplayValueLocalized(Item item,
DCValue[] values,
String schema,
String element,
String qualifier,
Locale locale)
throws 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 field
SQLException
DCInputsReaderException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||