Skip to content

Home

Development

IDEs

JAR services

API Explorer

SpringMethods

The SpringMethods class contains one-liners for adding and removing Spring context files from a Martini package.

addContextFile

The addContextFile(...) method is used to add a Spring context file to a Martini package. There are two variations of this method that can be used:

  • SpringMethods.addContextFile(String, InputStream, String, boolean)
  • SpringMethods.addContextFile(String, String, String, boolean)

Parameters

Property index Type Description
fileName 0 java.lang.String The name of the Spring context file.
contents 1 java.lang.String The string content of the Spring context file.
contents 1 java.io.InputStream The InputStream of the Spring context file.
packageName 2 java.lang.String The name of the Martini package where the context file will reside.
replaceExisting 3 java.lang.boolean Whether or not to overwrite the Spring context file, if it already exists.

Usage

Sample Gloop service showing how to use the `addContextFile(String, String, String, boolean)` one-liner of `SpringMethods`

removeContextFile

The removeContextFile(String, String, boolean) method is used to remove a Spring context file from a Martini package.

Parameters

Property index Type Description
fileName 0 java.lang.String The name of the context file to delete.
packageName 1 java.lang.String The name of the Martini package where the context file resides.
removeFiles 2 java.lang.boolean If false, Martini will only unregister the Spring context from memory. If true, Martini will do the same but also delete the context file nn the file system.

Usage

Sample Gloop service showing how to use the `removeContextFile(String, String, boolean)` one-liner of `SpringMethods`