• Post Reply Bookmark Topic Watch Topic
  • New Topic

Filesystem path contains .'s -how to package  RSS feed

 
Ian Montgomery
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a filesystem path contains a directory structure with dots ( /this/2.0.8/bin ), how do I handle that in a package name ( this.2.0.8.bin )?
Thank you.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a filesystem path contains a directory structure with dots ( /this/2.0.8/bin ), how do I handle that in a package name ( this.2.0.8.bin )?
That's an interesting dillema. I think the short answer is don't use dots in your directory names. The package name you suggest would point to this/2/0/8/bin, if a subpackage name could start with a digit, which it can't. Regardless, package names should be designed to be meaninful and intuitive, the example you gave is far from either.
 
Ian Montgomery
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, that is the dilema. Path is on an existing system and, unfortunately, can't be changed. I guess I'll see if I can put my .jar elsewhere.
Thank you.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are just looking to place a jar, then this isn't a problem. Just make sure that the structure in the jar reflects the class structure and edit the CLASSPATH to include this/2.0.8/bin/myjar.jar.
In this case, you don't need to identify these directories in the code yourself.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!