Template file creation with ms dos commands, has to create program templates with given parameters and bind this parameter dynamically to defined template. This reduces more time to create files or program for software development.
Example program to create java spring controller to with parameters. such as method name, request url and return type esc.,
|
@echo off
SET /p filename=Enter the filename
SET /p requesturl=Enter the Request URL
SET /p requesturlmethod=Enter the Request URL Method(POST/GET)
SET /p responsetype=Enter the Response Type
echo. @RequestMapping(value="/%requesturl%",method=RequestMethod.%requesturlmethod%) > %filename%.txt
echo. public @ResponseBody %responsetype% %requesturl%() throws Exception { >> %filename%.txt
echo. } >> %filename%.txt
SET /p exit=File is created successfully! (Press any key to exit)
|
Example with arguments based template file creation
@echo off
REM how to run: runit.bat "filename" "requesturl" "requesturlmethod" "responsetype"
echo. @RequestMapping(value="/%~2",method=RequestMethod.%~3) > %~1.txt
echo. public @ResponseBody %~4 %~2() throws Exception { >> %~1.txt
echo. } >> %~1.txt
SET /p exit=File is created successfully! (Press any key to exit)
|