Deleting programmaticaly xul files
sgfdgf ryejt <[email protected]> Thu, 10 Feb 2005 04:18:56 +0100 (CET)
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
--0-1665304528-1108005536=:40218
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Hi all,
=20
My application dynamically generates xul files and copy them in the chrom=
e/startup directory. Then I use Luxor to render them in a java environmen=
t. But once the rendering is done, I would like to delete these xul files=
.
=20
To do so:
=20
File file =3D new file ("chrome/startup/myfile.xul");
boolean b =3D file.delete();
=20
However, 90% (yes, not 100%) of the times, I cannot delete them and b =3D=
=3D false.
=20
I suspect, the xul file might be used my a thread or something. However I=
can delete it manually from the windows explorer...
=20
I tried, in vain:
while (!file.delete()) {} which loops forever...
=20
I also tried to modify the method:
=20
XulLoader.load(String name) {
{
try
{
T.debug( "loading xul file " + name );
InputStream in =3D _loader.getResourceAsStream( name );
SAXBuilder builder =3D new SAXBuilder();
Document doc =3D builder.build( in );
Element xul =3D doc.getRootElement();
createElements( null, xul );
T.debug( "xul file " + name + " successfully loaded" );
// Here's my modification...
try {
in.close();
}
catch (IOException ex) {
}
}
catch( JDOMException jex )
{
Xul.Error.XUL_PARSING_EXCEPTION( name, jex );
}
}
...didn't work either....
Would you have an idea of how to fix this?
=20
Cheers,
=20
Julien
=20
=09
---------------------------------
D=E9couvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vo=
s mails !
Cr=E9ez votre Yahoo! Mail
--0-1665304528-1108005536=:40218
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>My application dynamically generates xul files and copy them in the =
chrome/startup directory. Then I use Luxor to render them in a java envir=
onment. But once the rendering is done, I would like to delete these xul =
files.</DIV>
<DIV> </DIV>
<DIV>To do so:</DIV>
<DIV> </DIV>
<DIV>File file =3D new file ("chrome/startup/myfile.xul");<BR>boolean b =3D=
file.delete();</DIV>
<DIV> </DIV>
<DIV>However, 90% (yes, not 100%) of the times, I cannot delete them and =
b =3D=3D false.</DIV>
<DIV> </DIV>
<DIV>I suspect, the xul file might be used my a thread or something. Howe=
ver I can delete it manually from the windows explorer...</DIV>
<DIV> </DIV>
<DIV>I tried, in vain:</DIV>
<DIV><BR>while (!file.delete()) {} which loops forever...</DIV>
<DIV> </DIV>
<DIV>I also tried to modify the method:</DIV>
<DIV> </DIV>
<DIV>XulLoader.load(String name) {<BR> {<BR>  =
; try<BR> {<BR> &nbs=
p; T.debug( "loading xul file " + name );<B=
R> InputStream in =3D _lo=
ader.getResourceAsStream( name );</DIV>
<DIV> SAXBuilder builder =
=3D new SAXBuilder();<BR> =
Document doc =3D builder.build( in );</DIV>
<DIV> Element xul =3D doc=
.getRootElement();<BR> cr=
eateElements( null, xul );<BR> &=
nbsp; T.debug( "xul file " + name + " successfully loaded" );</DIV>
<DIV> // Here's my modification=
...<BR> try {<BR> &n=
bsp; in.close();<BR>  =
; }<BR> =
catch (IOException ex) {<BR> }=
<BR> }<BR> ca=
tch( JDOMException jex )<BR> {<BR> &nb=
sp; Xul.Error.XUL_PARSING_EXCEPTION( =
name, jex );<BR> }<BR> }</DIV>
<DIV><BR>...didn't work either....</DIV>
<DIV><BR>Would you have an idea of how to fix this?</DIV>
<DIV> </DIV>
<DIV>Cheers,</DIV>
<DIV> </DIV>
<DIV>Julien</DIV>
<DIV> </DIV><p>
<hr size=3D1>=20
D=E9couvrez le nouveau Yahoo! Mail : <font color=3D"red">250 Mo d'espace<=
/font> de stockage pour vos mails !<br><a href=3D"http://fr.rd.yahoo.com/=
mail/taglines/*http://fr.rd.yahoo.com/evt=3D25917/*http://fr.rd.yahoo.com=
/mail_fr/mail_campaigns/splash/taglines_250/default/*http://fr.promotions=
.yahoo.com/mail/creer28.html">Cr=E9ez votre Yahoo! Mail</a>
--0-1665304528-1108005536=:40218--
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click