Accessing a Java resource as a file
Here is some quick and dirty code to get access to a resource on the class path as a File object:
URL url = this.getClass().getResource("/the-file.txt");
URI uri = new URI(url.toExternalForm());
File f = new File(uri);
Obviously replace "/the-file.txt" with the actual path to the resource. Note: this is the path on the "class path", not the file system.
Posted by rickg ( Jun 10 2008, 11:55:38 PM PDT ) Permalink Comments [0]Unable to Run Windows Update
I upgraded an old Windows 2000 virtual machine to Windows XP today, and afterwards tried to run Windows Update, but got the following error.
The following updates were not installed:
Windows Genuine Advantage Validation Tool (KB892130)
Update for Windows XP (KB898461)
Since these updated are required to download any further updates (like XP SP3), I was hosed. Well, not quite. After some time with Microsoft support, we did finally find a workaround, listed below:
====================================
1. Please download the file from the following link:
http://download.windowsupdate.com/v7/windowsupdate/redist/standalone/WindowsUpdateAgent30-x86.exe
2. Save the file to "C: drive".
3. Click "Start", "Run", type: "C:\WindowsUpdateAgent30-x86.exe /wuforce" (without quotations) and then press "Enter" to install the Windows Update engine.
There is a space between "C:\WindowsUpdateAgent30-x86.exe" and "/wuforce".
===================
After that I could run Windows Update successfully.
Posted by rickg ( Jun 08 2008, 10:36:30 PM PDT ) Permalink Comments [0]
