Article View: borland.public.jbuilder.java.language
Article #8312Re: Unique file name
From: se wen
Date: Thu, 29 Mar 2001 22:29
Date: Thu, 29 Mar 2001 22:29
38 lines
2376 bytes
2376 bytes
Hi Joi Ellis,
Thanks for your response. I think I need to explain a little more in what I
am attempting to accomplish.
My project currently creates a chart image and stores it in a directory (see
code) with a specified file name "chart.PNG".
.................................................................
JCEncodeComponent.encode(JCEncodeComponent.PNG, SESChart.snapshot(), new
File("c:/Windows/jbproject/untitled8/src/untitled8/chart.PNG"));
.................................................................
However, since there will be multiple users and threads at the same time
accessing the chart method we need some method that can scan the name of the
files in the directory (for the above example it would be 'untitled8') then
assign a new name that does not already exist in that directory. This name
would need to be able to be stored as a variable so that it can be passed to
the above encoding method.
Thanks again for your suggestions
Stuart
"Joi Ellis [TeamB]" <joi@aravox.com> wrote in message
news:3ac3a833_1@dnews...
> se wen <se_wen@nightmail> wrote:
> > Hi,
> > Does anyone know of any examples that can generate a unique file name,
which
> > can be stored as a variable to be passed to a method?
>
> java.io.File.createTempFile() ?
>
> --
> Joi Ellis (TeamB)
> No direct email, please.
> For best results, post on news server newsgroups.borland.com!
> Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<3ac3b766$1_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!newsfeed.icl.net!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews!129.93.20.70References:
<3ac3a412$1_1@dnews> <3ac3a833_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a9c867af487cce47 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-29 14:36:08 PST From: "se wen" <se_wen@nightmail> Newsgroups: borland.public.jbuilder.java.language References: <3ac3a412$1_1@dnews> <3ac3a833_1@dnews> Subject: Re: Unique file name Date: Thu, 29 Mar 2001 16:29:57 -0600 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 NNTP-Posting-Host: 129.93.20.70 Message-ID: <3ac3b766$1_1@dnews> X-Trace: 29 Mar 2001 14:29:58 -0800, 129.93.20.70 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!newsfeed.icl.net!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews!129.93.20.70