Re: (No subject)
Re: (No subject)
- Subject: Re: (No subject)
- From: "Robert A. Decker" <email@hidden>
- Date: Mon, 13 Oct 2003 10:43:28 -0700 (PDT)
Well, for example, if you use lucene and just want to do a quick check to
see if a document index exists, you can just check for the existence of
the index directory. That's not a great example in my case though because
I actually keep my lucene index under ~ even though it's on a
per-application basis.
You definitely wouldn't be storing something like that in a .jar.
Another example is a config file that we keep as a Resource in the
application. We sometimes have need to edit the file on the server while
the application is running, and keeping it in a .jar adds extra work. I
could probably move this to ~ as well, but this one really does make sense
to keep under the application.
I can also see times where third-party code may only accept a path as
an argument. Again, I don't have a good example - I thought I did with
reportmill, but did find the consructor that takes an InputStream.
There's workarounds, but it sometimes does make sense that you just want
the path to the resource.
Does it really make sense to store application resources in a jar? Is that
just how it's done in java apps?
thanks,
Robert A. Decker
http://www.robdecker.com/
On Mon, 13 Oct 2003 email@hidden wrote:
> The problem is that it's not just the method name that's deprecated, it's
> actually the BEHAVIOR you are trying to accomplish. Needing to know the
> actual path of the resource, that's deprecated. This is presumably
> because WO is trying to move to storing resources in a .jar file (perhaps
> for J2EE deployment it already does not, not sure), in which case there
> isn't really a file path to the resource. The resource is inside a jar file.
>
> By deprecating that method, they're trying to get you to avoid designs
> where you need to know a file path to a resource, because this may not
> always be possible, in every deployment configuration.
>
> I'm curious why you do need to know the file path, I've never needed this
> before myself. But I'm sure there are reasons. You could either try to
> redesign your code to not need this, or you could just keep using it, and
> deal with it, if it ever becomes impossible because of your deployment
> configuration or future changes to WO.
>
>
> "Robert A. Decker" <email@hidden> writes:
>
> Is there a method around that gives the same results without a deprecated
> warning method? Nothing is apparent in WOResourceManager.
>
> There are times where I really do want a path, and not an InputStream or
> byte array.
>
> thanks,
> Robert A. Decker
>
> http://www.robdecker.com/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.