Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stupid question about JFileChooser  RSS feed

 
Alan Christen
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

/****************DISCLAIMER****************/
I am a self-taught, beginning programmer with Java. So what, you asked? Well, there is a *lot* of the "basics" that I don't have...lots of things that aren't so obvious to me. You have been warned.
/****************DISCLAIMER****************/

I have a built a very simple application using Swing & JFileChooser. All that is does is open up Oracle SQL*Loader log files: then the user can check for error messages.

My JAR is on a MS Windows workstation and the log files are on a Unix server. A batch file FTPs every day the files to a directory on the MS Windows workstation.

I want to enhance my application so that I can use JFileChooser to grab the files directly from the Unix server.

I have a hostname/ip address as well as username/password for that Unix server. I have r/w access to the directory where the log files are.

Is it possible? Can someone please provide a few pointers?

Thanks for your time.

Al.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alan Christen:
I have a hostname/ip address as well as username/password for that Unix server. I have r/w access to the directory where the log files are.
Does this mean you can map a Windows drive to that Unix directory? If so, then do that before you run your Java application. Then use your JFileChooser to navigate to that directory.

As you can see, that wasn't really a question about JFileChooser at all. But when you're just starting out, it's hard to see what's what. But just to make clear, JFileChooser is simply a tool for choosing files from the file system. If you have a problem with the underlying file system, you shouldn't be looking to solve it with JFileChooser.
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it should be possible to use a JFileChooser that can look directly on the Unix filesystem without a network mapping. The problem is, it will most likely be very, very, very difficult. You'll have to create a new FileSystemView, and most likely a new subclass of File as well to interact with both the FileSystemView and the remote file system. That's really not a job for a beginner - it's even hard for advanced users.

My suggestion: use a network mapping like Paul said. You can make sure Windows recreates the mapping, or even have a login script create it for every user that logs into the (company) network.
 
Alan Christen
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul/Rob-

Thanks for your replies. Obviously, the simple way to do this is by creating a network mapping using Samba...

It is also obvious that this has really nothing to do with JFileChooser.

My apologies for the confusion.

Thanks again for your prompt replies.

Al.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!