Welcome to Dream.In.Code
Become a Java Expert!

Join 150,057 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,735 people online right now. Registration is fast and FREE... Join Now!




FileNameExtensionFilter in Java 5

 
Reply to this topicStart new topic

FileNameExtensionFilter in Java 5

Ludmilla
3 Jun, 2008 - 04:33 AM
Post #1

New D.I.C Head
*

Joined: 3 Jun, 2008
Posts: 3


My Contributions
How can I replace FileNameExtensionFilter in Java 5?
User is offlineProfile CardPM
+Quote Post

1lacca
RE: FileNameExtensionFilter In Java 5
3 Jun, 2008 - 04:56 AM
Post #2

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
Are you sure that this is a standard Java API class?
If not, then please post the code necessary to understand your question (source of FileNameExtensionFilter and it's driver class(es)).

User is offlineProfile CardPM
+Quote Post

Ludmilla
RE: FileNameExtensionFilter In Java 5
3 Jun, 2008 - 05:48 AM
Post #3

New D.I.C Head
*

Joined: 3 Jun, 2008
Posts: 3


My Contributions
QUOTE(1lacca @ 3 Jun, 2008 - 05:56 AM) *

Are you sure that this is a standard Java API class?
If not, then please post the code necessary to understand your question (source of FileNameExtensionFilter and it's driver class(es)).


Yeah, for Java 6. I need the same functionality for Java5.
The source is:
protected FileFilter createFileFilter(String description, boolean showExtensionInDescription, String... extensions) {
if (showExtensionInDescription) {
description = createFileNameFilterDescriptionFromExtensions(
description, extensions);
}
return new FileNameExtensionFilter(description, extensions);
}

User is offlineProfile CardPM
+Quote Post

1lacca
RE: FileNameExtensionFilter In Java 5
3 Jun, 2008 - 06:30 AM
Post #4

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
I see. I would suggest simply download it's source, and insert it into your project, but into a different package from the original, so you won't have problems if you upgrade your Java version later.
An example is here
It is quite well documented as well.
User is offlineProfile CardPM
+Quote Post

Ludmilla
RE: FileNameExtensionFilter In Java 5
4 Jun, 2008 - 03:48 AM
Post #5

New D.I.C Head
*

Joined: 3 Jun, 2008
Posts: 3


My Contributions
QUOTE(1lacca @ 3 Jun, 2008 - 07:30 AM) *

I see. I would suggest simply download it's source, and insert it into your project, but into a different package from the original, so you won't have problems if you upgrade your Java version later.
An example is here
It is quite well documented as well.

Thanks a lot. I used your suggestion in my project yesterday and it works well.
Thanks once more smile.gif
User is offlineProfile CardPM
+Quote Post

1lacca
RE: FileNameExtensionFilter In Java 5
4 Jun, 2008 - 03:59 AM
Post #6

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
You are welcome!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:31PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month