|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ginp.util.GinpUtil
public class GinpUtil
Internationalization stuff These are for server side messages that won't go out to the client so we can use whatever the JVM's locale is.
Field Summary | |
---|---|
static java.lang.String |
CREATE_CONFIG_ERROR
CREATE_CONFIG_ERROR - if there's an error creating the config |
Constructor Summary | |
---|---|
GinpUtil()
|
Method Summary | |
---|---|
static boolean |
empty(java.lang.String adminPassword)
|
static java.lang.String |
getConfigFileRealPath()
|
static java.lang.String |
message(java.lang.String key)
Get a normal internationalied message |
static java.lang.String |
message(java.lang.String key,
java.lang.Object[] args)
Get an Internationalized Message encoded with a Message Format. |
static int |
parseInteger(javax.servlet.http.HttpServletRequest req,
java.lang.String param,
int defaultVal)
Parse an integer from a string and handle exceptions gracefully |
static int |
parseInteger(java.lang.String value,
int defaultVal)
|
static java.lang.String |
readBufferIntoMemory(java.io.InputStream stream)
Reads the input stream into memory |
static org.dom4j.Document |
transform(java.lang.String stylePath,
org.dom4j.Document visitDoc)
|
static void |
writeInputStreamToOutputStream(java.io.OutputStream sos,
java.io.InputStream is)
Writes the entire input stream to the output stream then closes the input stream |
static void |
writeScaledImageToStream(java.io.OutputStream sos,
java.io.InputStream is,
int width,
int height)
Take a jpeg from an input stream and write it to an output stream with a scaled width and height |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CREATE_CONFIG_ERROR
CREATE_CONFIG_ERROR
- if there's an error creating the config
Constructor Detail |
---|
public GinpUtil()
Method Detail |
---|
public static java.lang.String message(java.lang.String key, java.lang.Object[] args)
key
- the message keyargs
- keys for messageformat
public static java.lang.String message(java.lang.String key)
key
- the key
public static java.lang.String readBufferIntoMemory(java.io.InputStream stream) throws java.io.IOException
stream
- the stream
java.io.IOException
public static org.dom4j.Document transform(java.lang.String stylePath, org.dom4j.Document visitDoc) throws javax.xml.transform.TransformerException
stylePath
- the classpath resource name of the transforming xsl docvisitDoc
- the doc to transform
javax.xml.transform.TransformerException
public static boolean empty(java.lang.String adminPassword)
adminPassword
- a string
public static int parseInteger(javax.servlet.http.HttpServletRequest req, java.lang.String param, int defaultVal)
req
- the servlet request to get the parameter fromparam
- the name of the parameterdefaultVal
- the default value if parsing fails
public static int parseInteger(java.lang.String value, int defaultVal)
public static void writeScaledImageToStream(java.io.OutputStream sos, java.io.InputStream is, int width, int height) throws java.io.IOException
sos
- output stream for imageis
- input stream for imagewidth
- widthheight
- height
java.io.IOException
- if there is an error writing or readingpublic static void writeInputStreamToOutputStream(java.io.OutputStream sos, java.io.InputStream is) throws java.io.IOException
sos
- output streamis
- input stream
java.io.IOException
- if there is an error reading or writingpublic static java.lang.String getConfigFileRealPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |