Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Filename case sensitiveness in JARs...  (Read 1559 times)
0 Members and 1 Guest are viewing this topic.
Offline Preston

Senior Member


Medals: 4



« Posted 2003-12-10 11:59:47 »

Is it possible to disable the filename case sensitiveness of the JAR's file system (accessed via getClassLoader().getResourceAsStream(file_url) ) temporary ?

Actually I like this filename case sensitiveness and usually it's no problem when you create your resource files.
However, say, some other person(s) alters your resources in a networked directory and this happens frquently...

Is there a magic switch somewhere ;-) or do I have to add some GAWK lines to my JAR packing procedure?
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #1 - Posted 2003-12-10 21:33:53 »

I tend to feel that the better solution is to take a crowbar to whomever keeps messing with the filename case.  Otherwise you're going to have horrible problems the moment you do want to distinguish based on case...

URLs are case sensitive.  Coding around such a fundamental reality will probably be damaging in the long run.

Hellomynameis Charlie Dobbie.
Offline Preston

Senior Member


Medals: 4



« Reply #2 - Posted 2003-12-11 04:44:45 »

Thanks for the answer.
I see. So I'll have to transform somehow the filenames inside the 3d model files to stay together with what is stored in the directories...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2003-12-11 06:04:47 »

Yep.  Java resource names are case sensative.

You COULD write a custom classloader that redefined "findResource" to match case insensitive.

That woudl be pretty evil though....

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Preston

Senior Member


Medals: 4



« Reply #4 - Posted 2003-12-11 07:19:10 »

Quote
Yep.  Java resource names are case sensative.

Actually I like this feature. Remembers me to Unix. Probably with MacOS-X file names are case sensitive, too? (It's based on Unix, after all.)  So just the Windoze users have this case sensitive problem when moving resource files to JARs, because those artists with Windoze systems never care about the file name cases when they do their models/scenes.

Quote
You COULD write a custom classloader that redefined "findResource" to match case insensitive.

That woudl be pretty evil though....

Yes.
Well, I'm going to add some AWK lines to my JAR packing script and also add some Regexps to the Java 3d model loader.


Btw. Those at SUN who decided to include Regexps with Java are my "local hero" (nice movie btw). Regexps are so cool.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #5 - Posted 2003-12-11 12:24:08 »

Quote

Actually I like this feature. Remembers me to Unix. Probably with MacOS-X file names are case sensitive, too? (It's based on Unix, after all.)  So just the Windoze users have this case sensitive problem when moving resource files to JARs, because those artists with Windoze systems never care about the file name cases when they do their models/scenes.


No, lots of linux users who access foreign filing systems too - either network shares or FAT etc (NB it's not just windows that uses FAT...). There are bugs in the linux kernel/filesystems which mean it artificially alters case on lots of filesystems; main example is all-uppercase filename ALWAYS get transformed to all lowercase. There is AFAIAA currently NO way around this (have to ask java developers to change their class names if they have any all upper case, or else copy everything to a different filesystem; however, IIRC when you copy it back, the stupid linux FS subsystem does the translate again!).

malloc will be first against the wall when the revolution comes...
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #6 - Posted 2003-12-11 12:32:23 »

Quote

URLs are case sensitive.  Coding around such a fundamental reality will probably be damaging in the long run.


IIRC this is not *completely* true? (but its been a while since I was reading the appropriate RFC's etc...).

Some sections of a URL are case-insensitive. E.g. the DNS system is case-insensitive, and IIRC web-server developers are requested to make their filenames case-insensitive BUT "case preserving" - e.g. so that URL queries that contain data e.g. from a form are not transformed?

Ditto IIRC the protocol field in a URL/URI?

I remember a time when many webservers were case sensitive, but that has definitely changed - but this could easily just be for convenience so I really don't know.

P.S. Case sensitivity is, in general, a bad idea in user interfaces. OTOH it is just as powerfully a very very good idea in non-user stuff, like code; not because it makes it easier to write code, but because it's easier to transfer around data, where different case has a lot more meaning, and case-sensitive systems can safely be used as a vector for such data (e.g. linux cannot [always], as described above, and this is a pain and a problem). IMHO, URL's are aimed more at users and so ought to be case insensitive; ditto filenames. I use both sensitive and insensitive FS's so much I automatically know which is which without thinking about it, but IME it has often been the cause of many problems and bugs in multi-person teams...

malloc will be first against the wall when the revolution comes...
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #7 - Posted 2003-12-12 13:54:21 »

Quote
IIRC this is not *completely* true? (but its been a while since I was reading the appropriate RFC's etc...).


Yeah, not completely true, but near enough! Grin

I believe for all/most Internet-relevant URLs the protocol is case-insensitive, username/password is left to the implementation (usually case-sensitive), the server name is case-insensitive, and the path is all case-sensitive.  But unless you're writing something to interpret and act on URLs, nothing can go wrong if you treat the whole thing as case-sensitive.

Hellomynameis Charlie Dobbie.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (46 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (32 views)
2014-07-23 20:56:16
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!