Checking files and directories with the <fileTest> rule

Author: BitRock Support       Date: January 09, 2010 11:28       Tags: Rules

InstallBuilder allow to check files and directories properties through the <fileTest> rule. This rule accepts the below tests:

  • exists: Exists
  • not_exists: Does not exist
  • writable: Is writable
  • not_writable: Is not writable
  • readable: Is readable
  • not_readable: Is not readable
  • executable: Is executable
  • not_executable: Is not executable
  • is_directory: Is a directory
  • is_not_directory: Is not a directory
  • is_symlink: Is a symbolic link
  • is_not_symlink: Is not a symbolic link
  • is_file: Is a file
  • is_not_file: Is not a file
  • is_empty: Is empty
  • is_not_empty: Is not empty
The conditions is_empty and is_not_empty above both apply to files and directories. When used over a directory, it will check if it contains any file and if used over a file, it will check its contents (size). If you want to avoid false results when checking a directory (or file) you can combine it with another fileTest rule to enforce the file type:

<!-- We don't want an empty file to return '1' -->
<ruleList>
 <fileTest condition="is_directory" path="${path}" />
 <fileTest condition="is_empty" path="${path}" />
</ruleList>


This will work if the <ruleEvaluationLogic> is 'and', if you need it to be 'or' to create a more complex rule, you can use a ruleGroup:

<showInfo text="Is Windows or directory ${path} is empty">
  <ruleEvaluationLogic>or</ruleEvaluationLogic>
  <ruleList>
     <!-- This ruleGroup is equivalent to a is_directory_and_empty test -->
     <ruleGroup>
       <ruleList>
         <fileTest condition="is_directory" path="${path}" />
         <fileTest condition="is_empty" path="${path}" />
       </ruleList>
     </ruleGroup>
  </ruleList>
</showInfo>

Comments

how to make installer from a jsp web application u

Author: zahid392       Date: January 25, 2010 12:32

hello,
i am new in bitrock.i have a web application written in jsp/servlet and it runs in tomcat server and using mysql database.now my task is to make this web application as a desktop installer where the tomcat and mysql will be embeded with the installation and all my data will be populated int mysql db..

now my question is could i achieve this with bitrock .if yesy then how?plaes explain.

thanx in advance.

zahid


 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up