Hi,

you can use this method from the File class: listFiles(FileFilter filter)

it will give you a list with only the file the you want. You have to create
a class that extends FileFilter and override the accept method. That is very
simple, you have to look the filenames that end with "htm" or "html", don�t
forget to put everything to lowercase or uppercase before you search the
string.

I hope that helps

Leila

> Hi,
>
> Thanks Shahzad.
> Still a problem.
> I'd somehow like to retrieve names of only .html files in a folder and
> perform an operation on these files one by one. Tried using list() and
> list(FilenameFilter  fileStr)methods but was unsucessful.
>
> Alternatively I'd like to use the isFile() method and perform
> some operation
> on this file. How do I use isFile() method?
>
> Thanks in advance.
>
> Regards,
> Sameer
>
> ----- Original Message -----
> From: "[Shahzad Mahmood]" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 15, 2000 12:09 PM
> Subject: Re: directory info using java
>
>
> > Hi,
> > U can use
> > java.io.File
> >
> >
> > java.io.File dir = new java.io.File(" folder path");
> >
> > String[] list = dir.list();
> >
> > array will b containing the names of files and subfolders
> in the specified
> > folder.
> >
> > shahzad
> >
> >
> >
> >
> >
> >
> >
> > hi everybody,
> >
> > I need to get a list of all filenames and subfolders residing in a
> specific
> > directory because I need to make some changes in a lot of files.
> >
> > Could anyone help me with a java application or applet
> which achieves the
> > above without of course changing each file individually.
> >
> > thanks in anticipation,
> > Sameer
> >
> >

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to