1

I have a custom "container" folder. I named it .llp. It is actually a folder which contains inside 2 files that I actually need.

Then I use JFileChooser and tell it to display only .llp files. But if I select any of those .llp files/folders it opens them and I see files in it. I could use workaround:

fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

But then user can select some different folders as well.

I would be much happier if when I could create that .llp file/container and that system treat it as a file container, not as a folder. For example, if I double click on it, I don't want it to open but to ask me which program do I want to use to open .llp file type.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
vale4674
  • 4,161
  • 13
  • 47
  • 72
  • 4
    how about a .zip file or perhaps more appropriately a .jar file? The filesystem would then see it as a single file, but I seem to recall you could easily open it from Java code and read the contents. – Nerdtron Dec 15 '11 at 15:11
  • I also programmatically create those .llp files. Can I create .zip from java and rename it to .llp? – vale4674 Dec 15 '11 at 15:14
  • @vale4674 you can name zip files whatever you want to. – Stefan Dec 15 '11 at 15:24
  • Check [this post on how to create a zip file](http://stackoverflow.com/q/1091788/741249) – THelper Dec 15 '11 at 15:43
  • @ Nerdtron I did it with zip file folowing [this](http://www.exampledepot.com/egs/java.util.zip/CreateZip.html) example. Tnx – vale4674 Dec 15 '11 at 22:04

1 Answers1

1

Since nedtron didn't put his answer in answer section but in comments I'll answer it.

.zip is the solution.

vale4674
  • 4,161
  • 13
  • 47
  • 72