Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IOException:bad path

Status
Not open for further replies.

JDOne

Programmer
Apr 9, 2003
40
US
I wrote functionality which downloads certain files containing an applet based upon whether the certain workstation contains the path D:/Documents and Settings/username/Application Data (like Win 2K environment) or if a workstation does not have the D drive path specs (like Win95, etc) and has a C:/Program Files path. The logic checks to see if the D drive specs exist, if so, then make that the default directory to download the files - if not, then make the C drive specs the default directory to download the files. The functionality to download the files to its proper default directory works fine. In the W2K environment (D drive spec), the downloaded html file containing the applet launches with no problem. However, for those other workstations which DO NOT have the D drive specs, like Win 95, or 98, etc. and only use the C drive specs - although all of the files are downloaded to its proper place in the C drive, the applet won't launch. Instead, what I get is a java.ioException: bad path D:/Documents and Settings...etc. It seems weird because on the one hand, the files are placed in the proper folder, but yet the error indicates that its looking for the D drive specs which of course do not exist in that environment. The code is very straight-forward so its kinda baffling to see this occuring. Does anyone have any ideas or past experiences in an issue like this who can shed some light on a resolution?

Thanks.

J
 
Post some code, maybe someone can help. Not sure exactly what you are trying to do, but it seems like you are trying to get a file from the users temp directory on any Windows machine (95,98,2000, etc.) If that's the case, why not get the USERPROFILE environment variable, then you will always have the proper base directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top