- This topic has 3 replies, 3 voices, and was last updated 16 years, 10 months ago by Riyad Kalla.
-
AuthorPosts
-
edbrasMemberHellu,
I see that if I create a new folder with the name “public” in an existing package, that it is seen as a resource folder instead of a package.
How can I realize the same result for folders with other names (name web instead as public for example)?
I hope you understand me, otherwise, just create a folder public in a package and a folder bla in an existing package.. and you will see what I mean….
I searched about everywhere, but I can’t find it…. 🙁
Please some advice
Loyal WaterMemberYou cannot use public since it is not a valid Java identifier for packages.
edbrasMemberThank you for your quick answer.
I am aware that public isn’t a valid pacakge identier, but that’s not what I like to know.
I want to indicate if something is a resource folder or a package identifier.
The name “public” isn’t a valid identifier and as such automatically seen as a resource folder.
However I would like to indicate this, such that if I create a folder in com.bla.some is also treated as a resource folder, just as “public”
Riyad KallaMemberEd, there is no such thing as a resource folder in Eclipse… just create any package you want, and put whatever you want in it. Normally people indicate the use of the particular package by it’s name, for example int he Swing App framework, any package named “resources” is automatically treated as the resource package (properties files, images, etc.) for classes in the package above it… like:
com.myapp.resources
that package would have resources for the UI classes in com.myapp
The only reason your folder named “public” is showing up as a non-package, is because it’s an illegal package name, so Eclipse is forcibly removing it from the package hierarchy and changing it’s icon, instead of giving you a warning saying “don’t use that name”.
Hope that helps.
-
AuthorPosts