Installation guide

<CFFILE ACTION=”delete” FILE=”C:\Inetpub\wwwroot\images\a.jpg”>
<CFFILE ACTION=”delete” FILE=”/images/a.jpg” URIDIRECTORY=”Yes”>
Specifying file attributes as relative URI paths improves the portability of CFML pages
by eliminating web server and operating system specific physical path specifications.
Note in the above example that the first tag is not portable to a Linux running Apache,
but the second one is.
The optional
URIDirectory attribute accepts the values “Yes” and “No”; the default
value is “No”.
4.5 New CFML Tags
This section lists new CFML tags that are unique to BlueDragon.
4.5.1 CFASSERT
CFASSERT is a new CFML tag introduced by BlueDragon that can be used as a testing
tool to enhance the reliability and robustness of your applications. The concept of using
assertions is frequently found in more advanced languages, and it’s critical to effective
unit-testing of your applications. Complete discussion of the benefits and uses of asser-
tions is beyond the scope of this manual, but a brief explanation follows.
CFASSERT (and its corresponding assert() function discussed in Section 5.4.1) takes an
expression that is expected to evaluate to a Boolean result (true or false). It throws an
exception if the result is false but does nothing if the result is true. They are also ignored
if assertions have not been enabled in the BlueDragon admin console, as discussed at the
end of this section. The intention is that you can place these assertions in your code to
help ensure that some expected state of the application is indeed occurring as expected.
More accurately, they cause failure if the state is not as expected.
A typical use is during testing, when you expect that a given variable will have a given
value (or perhaps a range of values), perhaps after calling a custom tag, UDF, or CFC
method. Another example is when you want to test the mere existence of a given variable
(such as an expected session or application variable).
The difference between this and using a
CFIF is that the CFIF is intended to control the
flow of the logic, executing code depending on a condition. An assertion test is intended
to simply throw an error is the expected condition is not true. The
CFIF test handles
expected conditions, while the assertion flags unexpected conditions.
It could be surrounded by a
CFTRY to catch and handle the error that will be thrown, or
the error can be allowed to pass up to the caller of the code throwing the exception. It
could also be left to be handled by any
CFERROR or site-wide error handler, or if unhan-
dled will simply result in a BlueDragon runtime error. (There is a body of opinion in the
industry that suggests that assertion failures should not be caught at runtime, or at least
ought not be used to alter the flow of processing and allow execution to continue. These
proponents expect that an assertion failure should result in a cease of processing.)
BlueDragon 6.1 CFML Compatibility and Reference Guide 23