• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JFileChooser and network share

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends!

I need to display network shares in a JFileChooser. It's possible to show the network shares of the concerning host via the network button. But I'd also like to display them hardcoded by invokation of:



The JFileChooser doesn't do nothing in this case. If I do specify the explicit share ressource it works:



I don't know the shared folders. So, I want to show the list of all shared folders of the concerning host. Is this impossible?

Best regards


PAX
 
Sheriff
Posts: 22832
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've tried with my own machine, and if I create a File around an actual share and call its exists() method, it returns true. If I create a File around the network host only (e.g. new File("\\\\hostname")), exists() returns false. As such, java.io.File is not the means to retrieving these. That also means that JFileChooser can't help you out, since it uses java.io.File in the background.
 
Andreas Pax Lück
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, that's really bad.

thanks for your help.

best regards

PAX
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using Windoze, you might find this thread useful
https://coderanch.com/t/463406/Swing-AWT-SWT-JFace/java/display-contents-My-Network-places
Some more info here http://www.infocellar.com/win98/networkneighborhood-nethood.htm
 
Andreas Pax Lück
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
these are interesting information. does the nethood location also have a common caption? i realized that its name isn't "NetHood" on systems with a different language than english.
 
reply
    Bookmark Topic Watch Topic
  • New Topic