You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Mustafa Ali, Halgurt" <Mu...@docomolab-euro.com> on 2003/09/16 14:24:59 UTC
File existence
Hi,
I have an application and I need to check whether a file exists or not,
I am getting a request-parameter value and I want to create a file with
this value as a file name, but first I want to check if this file
already exists or not, can anybody help me? Is there any possibility to
check that in a style sheet?
Best thank,
Halgurt
Re: File existence
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Mustafa Ali, Halgurt dijo:
> Hi,
>
> I have an application and I need to check whether a file exists or not,
> I am getting a request-parameter value and I want to create a file with
> this value as a file name, but first I want to check if this file
> already exists or not, can anybody help me? Is there any possibility to
> check that in a style sheet?
Hi:
A stylesheet is not the best place, but maybe this can helps you:
http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsSelector
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File existence
Posted by Olivier Billard <ob...@rennes.jouve.fr>.
Hi Mustafa,
Try the ResourceExistsAction
(http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/acting/ResourceExistsAction.html)
<map:act type="resource-exists">
<map:parameter name="url" value="context://data/{request-param:ir}.xml"/>
<!-- code if resource exists -->
</map:act>
<!-- code if resource doesn't exist -->
--
Olivier BILLARD
On 16/09/2003 14:24, Mustafa Ali, Halgurt wrote:
> Hi,
>
>
>
> I have an application and I need to check whether a file exists or not,
> I am getting a request-parameter value and I want to create a file with
> this value as a file name, but first I want to check if this file
> already exists or not, can anybody help me? Is there any possibility to
> check that in a style sheet?
>
>
>
> Best thank,
>
> Halgurt
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File existence
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Antonio Gallardo dijo:
> Upayavira dijo:
>> You can use the 'file exists' action or you can probably do the check
>> in
>> flowscript, with something like:
> Hi:
>
> Is this action being deprecated in favor of ResourceExistsSelector? See:
> http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsSelector
Sorry, I mean the link is:
http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsAction
Antonio Gallardo
>
> Best Regards,
>
> Antonio Gallardo
>
>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File existence
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Upayavira dijo:
> You can use the 'file exists' action or you can probably do the check in
> flowscript, with something like:
Hi:
Is this action being deprecated in favor of ResourceExistsSelector? See:
http://wiki.cocoondev.org/Wiki.jsp?page=ResourceExistsSelector
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File existence
Posted by Upayavira <uv...@upaya.co.uk>.
Mustafa Ali, Halgurt wrote:
> Hi,
>
>
>
> I have an application and I need to check whether a file exists or
> not, I am getting a request-parameter value and I want to create a
> file with this value as a file name, but first I want to check if this
> file already exists or not, can anybody help me? Is there any
> possibility to check that in a style sheet?
>
>
>
> Best thank,
>
> Halgurt
>
>
>
You can use the 'file exists' action or you can probably do the check in
flowscript, with something like:
var file = new java.io.File(filename);
if (file.exists()) {
...
}
(I've never tried either though).
HTH, Upayavira
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org