Re: Deprecated function - not clarified
Re: Deprecated function - not clarified
- Subject: Re: Deprecated function - not clarified
- From: Colin Clark <email@hidden>
- Date: Tue, 9 Nov 2004 11:50:28 -0500
On Tuesday, November 9, 2004, at 11:42 AM, Erwin wrote:
if we should not write the following statement :
String resourcePath = (String)rm.pathForResourceNamed( filename, framework, null );
how could it be replaced using 'inputStreamForResourceNamed' to get a resourcePath ?
InputStream resourceStream = (InputStream) rm.inputStreamForResourcedNamed( filename, framework, null );
how cn I get a File object to get its path ?
If all you need is the file path, use pathURLForResourceNamed() instead. This will give you the path as a URL object instead of as a plain string. You can then use the getPath() and/or getFile() methods on URL to pull out the path and filename as Strings.
If you read the Javadocs, you'll notice that inputStreamForResourceNamed() is designed to return the resource itself--not its path on the file system--as an InputStream object. This doesn't sound like what you want.
Colin
---
Colin Clark
Dynamic Web and Database Development Lead,
Resource Centre for Academic Technology,
University of Toronto
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden