com.jfw.update
Class ShellCmdUpdate

java.lang.Object
  extended by com.jfw.update.JFWUpdate
      extended by com.jfw.update.ShellCmdUpdate

public class ShellCmdUpdate
extends JFWUpdate

Extract files from the shell file. A valid name for the shell file is one who start with shell, example shell-dateandtime.zip.


Field Summary
static java.lang.String SHELL_FILE
          The name of the shell commands file.
 
Constructor Summary
ShellCmdUpdate()
           
 
Method Summary
protected  void executeCmd(java.lang.String cmdList)
          Execute the shell commands found in the shell file.
protected  java.lang.String getCmdFromFile(java.lang.String path, java.lang.String fileName)
          Get content of the shell file.
 boolean start()
          Elaborate the shell files.
 
Methods inherited from class com.jfw.update.JFWUpdate
cleanWebWork, deleteFile, getFiles, getGenericFilePath, getUpdateSrcPath, getUpdateWebTargetPath, getWebappPath, getWebWorkPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHELL_FILE

public static final java.lang.String SHELL_FILE
The name of the shell commands file. Only files start with this name will be elaborated by this class.

See Also:
Constant Field Values
Constructor Detail

ShellCmdUpdate

public ShellCmdUpdate()
Method Detail

start

public boolean start()
              throws JFWUpdateException
Elaborate the shell files. The zip file will be extract in same directory of the shell file.

Specified by:
start in class JFWUpdate
Returns:
true if has been found an update file, false in other case.
Throws:
JFWUpdateException

getCmdFromFile

protected java.lang.String getCmdFromFile(java.lang.String path,
                                          java.lang.String fileName)
                                   throws java.lang.Exception
Get content of the shell file.

Parameters:
path - the path of the shell file.
fileName - the name of the shell file.
Returns:
the content of the shell file.
Throws:
java.lang.Exception

executeCmd

protected void executeCmd(java.lang.String cmdList)
                   throws java.lang.Exception
Execute the shell commands found in the shell file.

Parameters:
cmdList - the shell commands. The shell commands are separated by ;.
Throws:
java.lang.Exception