gov.grants.apply.util
Class Utils

java.lang.Object
  extended bygov.grants.apply.util.Utils

public class Utils
extends java.lang.Object

Utility functions for S2S Server.

Author:
Brian Husted

Field Summary
static java.lang.String APP_PROP_FILE
           
static java.lang.String ATTACHMENT_KEY
           
static java.lang.String DATASOURCE_KEY
           
(package private) static org.apache.log4j.Logger log
           
static java.lang.String PRODUCTION_MODE
           
 
Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String getPathToWEB_INF()
           
static java.lang.String getProperty(java.lang.String key)
          Get a property value from the application properties file.
static java.util.Map getSOAPAttachments()
          Returns a Map with two Lists ByteArrayDataSource objects and DataSource objects.
static boolean isProductionMode()
          Returns true if the server is being executed at Grants.gov.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static final org.apache.log4j.Logger log

PRODUCTION_MODE

public static java.lang.String PRODUCTION_MODE

APP_PROP_FILE

public static final java.lang.String APP_PROP_FILE
See Also:
Constant Field Values

ATTACHMENT_KEY

public static final java.lang.String ATTACHMENT_KEY
See Also:
Constant Field Values

DATASOURCE_KEY

public static final java.lang.String DATASOURCE_KEY
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String key)
                                    throws java.io.IOException
Get a property value from the application properties file.

Parameters:
key - the String
Returns:
the property value or null if no property exists
Throws:
java.io.IOException

getPathToWEB_INF

public static java.lang.String getPathToWEB_INF()
Returns:
the string of the patch to WEB_INF.

isProductionMode

public static boolean isProductionMode()
Returns true if the server is being executed at Grants.gov. RI users should always set PRODUCTION_MODE property to false.

Returns:

getSOAPAttachments

public static java.util.Map getSOAPAttachments()
                                        throws java.lang.Exception
Returns a Map with two Lists ByteArrayDataSource objects and DataSource objects. If we are using DIME then the large attachments can be buffered to a File without having the entire file in memory at once. This is the purpose for passing an Input Stream to the ByteArrayDataSource.

Returns:
Throws:
java.lang.Exception