Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Case sensitivity in "getResourceAsStream(...)"?
Case sensitivity in "getResourceAsStream(...)"? [message #297422] Fri, 13 January 2006 09:24 Go to next message
Eclipse UserFriend
This is Eclipse 3.1.1 on WinXP.

We just encountered a strange failure which ->seems to be caused by
different case-sensitivity of "getResourceAsStream(...)" between when
the plugin was installed and run in a "real" instance of Eclipse and
when the plugin was run from a Plug-in Development perspective in a
instance of Eclipse spawned from the IDE.

It's a simple case of

InputStream ff =this.getClass().getResourceAsStream(fileName);

where "fileName" is just the base filename, not decorated with any
path or leading "/".

It turns out that the "fileName" string differed from the actual
name of the file in case, but was otherwise spelled correctly.

When run from a spawned instance of Eclipse from the development
envirionment, either through "Run" or "Debug", getResourceAsStream()
found and opened the file.

When the product was actually installed in an instance of Eclipse and
Eclipse was run as an application, the call returned "null".

When the string representation of the filename was corrected, the
call worked in both cases.

Is this a bug, or is something else going on?

--
Bert Hyman | Unisys - Roseville MN
bert.hyman@unisys.com | (651) 635-7791 | net2: 524-7791
Re: Case sensitivity in "getResourceAsStream(...)"? [message #297424 is a reply to message #297422] Fri, 13 January 2006 09:29 Go to previous messageGo to next message
Eclipse UserFriend
Bert Hyman wrote:
>
> Is this a bug, or is something else going on?

It's called windows :-)

My guess as to why ... in eclipse, it's just pointing to the
<project>/bin folder ... windows filename access is case insensitive.

When you deployed, it was probably a jar file ... case sensitive.

There might actually be a bug open (or at least marked as
RESOLVED-WONTFIX or RESOLVED-INVALID) about this.

Later,
PW
Re: Case sensitivity in "getResourceAsStream(...)"? [message #297425 is a reply to message #297424] Fri, 13 January 2006 09:53 Go to previous messageGo to next message
Eclipse UserFriend
pwebster@ca.ibm.com (Paul Webster) wrote in
news:dq8dgq$7h2$1@utils.eclipse.org:

> Bert Hyman wrote:
>>
>> Is this a bug, or is something else going on?
>
> It's called windows :-)
>
> My guess as to why ... in eclipse, it's just pointing to the
><project>/bin folder ... windows filename access is case
>insensitive.
>
> When you deployed, it was probably a jar file ... case sensitive.
>
> There might actually be a bug open (or at least marked as
> RESOLVED-WONTFIX or RESOLVED-INVALID) about this.

That's rather unfortunate, since it means that our current JUnit
testing regimen is invalid, at least for this particular sort of
error.

--
Bert Hyman | Unisys - Roseville MN
bert.hyman@unisys.com | (651) 635-7791 | net2: 524-7791
Re: Case sensitivity in "getResourceAsStream(...)"? [message #297464 is a reply to message #297425] Sat, 14 January 2006 19:02 Go to previous message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

One possibility is to mount a share that is on a remote Linux server that enforces case-sensitivity. Another is to have an NFS-mounted share which you can write files to.

Of course, if you've got a Linux box, you could always run your tests on that :-)

Alex.
Previous Topic:Help with eclipse install
Next Topic:Multiselect of elements and PropertyView changes
Goto Forum:
  


Current Time: Wed Jul 23 10:07:02 EDT 2025

Powered by FUDForum. Page generated in 0.17936 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top