nirjari patel wrote:If I want to have a dir structure as "com.vanguard\iw\config\xml" , how can I get it ?
To what end are you doing this? Seems like a pointless exercise to me, honestly. The way Java works is fine; it's best to just go with the flow rather than try to force your will. It has worked for countless number of applications and developers, why shouldn't it work for you? Designing the rest of your program should be challenging enough for your creativity without trying to fight the way Java expects packages to be structured as a hierarchy of directories in the file system.
Its nit a matter of use case. I am trying to understand this, as I am confused on this part.
I have seen same thing, while creating dir structure in eclipse. When I create a dir as com.vanguard.iw.config.xml , it would create a tree structure in eclipse as com\vanguard\iw\config\xml , but in one onstance I got dir as com.vanguard.iw.config.xml. Since then this question is in my mind.
please clarify this point for eclipse that how does com.vanguard.iw.config.xml recolve to dir structure and does not create one dir by the name "com.vanguard.iw.config.xml" ? When I create a dir on desktop and name it as "com.vanguard.iw.config.xml", it stays as name of that dir and does not resolve to tree structure. So, why , while creating dir in eclipse , that rule is not applicable ?
Because Eclipse is smart enough to understand that if you want to create a directory for the package "com.vanguard.iw.config.xml", you actually want a structure of nested directories ""com\vanguard\iw\config\xml".
Windows Explorer obviously doesn't know anything about Java, so if you create a directory named "com.vanguard.iw.config.xml" in Windows Explorer, then that's exactly what you'll get - a directory named "com.vanguard.iw.config.xml", and not a hierarchy of directories.
nirjari patel wrote:I have seen same thing, while creating dir structure in eclipse. When I create a dir as com.vanguard.iw.config.xml , it would create a tree structure in eclipse as com\vanguard\iw\config\xml , but in one onstance I got dir as com.vanguard.iw.config.xml. Since then this question is in my mind.
Look in your source directory under your Eclipse project where you think it has created a directory structure with '.' and you'll see it hasn't.
Eclipse has a file view (or something like that) which shows the directory structure and a project view which shows the logical structure of your project.
posted 4 years ago
I have not checked the behavior. But I believe it works the way, you guys explained. That clears my confusion.