
nyla.solutions.commas.file.ReplaceWithFormattedRelatedFileCommand Maven / Gradle / Ivy
The newest version!
package nyla.solutions.commas.file;
import java.io.File;
import java.util.Map;
import nyla.solutions.core.exception.RequiredException;
import nyla.solutions.core.exception.SystemException;
import nyla.solutions.core.io.IO;
import nyla.solutions.core.io.SynchronizedIO;
import nyla.solutions.core.util.Config;
import nyla.solutions.core.util.Debugger;
import nyla.solutions.core.util.JavaBean;
import nyla.solutions.core.util.Text;
/**
* This class includes the text content of a related file into the given file.
* The related file is read and formatted using the Text.format() method.
* The input text indicated by the replacementRE in the given execute method is replaced at runtime.
* @author Gregory Green
*
*/
public class ReplaceWithFormattedRelatedFileCommand implements FileCommand
{
/**
* Implement the file processing
* @param
*/
public Void execute(File file)
{
if( template == null || template.length() == 0)
throw new RequiredException("this.template");
if(this.replacementRE == null)
throw new RequiredException("this. in ReplaceWithFormattedFileCommand");
//read RACI HTML
try
{
SynchronizedIO io = SynchronizedIO.getInstance();
String includeFileContent = io.readFile(file.getAbsolutePath()+includeFileSufix);
//applied formatting
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy