Re: Deprecated function - not clarified
Re: Deprecated function - not clarified
- Subject: Re: Deprecated function - not clarified
- From: Erwin <email@hidden>
- Date: Wed, 10 Nov 2004 09:05:52 +0100
thanks that's what I need actually
interesting, in many examples or third-party frameworks 'pathForResourceNamed' is still used....
thanks to Jean-François and Pierre-Bernard for their suggestions
Erwin
Le Nov 9, 2004, à 5:50 PM, Colin Clark a écrit :
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