0

Imagine a project with files looks like:

   llib
    ├── com.jar
    ├── utlib
    │   ├── rd
    │   │   ├── d.jar
    │   │   └── r.jar
    │   └── u.jar
    └── weblib
        ├── a.jar
        └── b.jar

Imagine com.jar should have a stucture:

com
├── C.class
├── META-INF
│   └── MANIFEST.MF
├── util
│   ├── A.class
│   └── B.class
└── web
    ├── H.class
    └── S.class

I need to get the file structure in other project, and get class file structure of each jar file in this project. The result should be returned as a tree as above. How to do that?

EDIT:

Browse a project folder and build the folder structure as a tree. If there is jar file, build its class structure as a subtree. Programming in java and return a tree including folder structure and class structure. My output result should looks like:

llib
├── com
│   ├── C.class
│   ├── META-INF
│   │   └── MANIFEST.MF
│   ├── util
│   │   ├── A.class
│   │   └── B.class
│   └── web
│       ├── H.class
│       └── S.class
├── utlib
│   ├── rd
│   │   ├── d
│   │   │   └── subd
│   │   │       ├── D1.class
│   │   │       └── D2.class
│   │   └── r
│   │       └── R.class
│   └── u
│       └── U.class
└── weblib
    ├── a
    │   └── suba
    │       └── subaa
    │           └── SA.class
    └── b
        ├── B1.class
        ├── B2.class
        └── B3.class
Nick Dong
  • 3,638
  • 8
  • 47
  • 84
  • I don't get what you want to do? It is to browse an external folder structure (of a certain project) and build a tree in memory (also of the content of the jars inside), or print it to video. You want to do it in Java? (because you could do it directly in bash). – luiso1979 Sep 27 '13 at 08:10
  • Yes, browse a project folder and build the folder structure as a tree. If there is jar file, build its class structure as a subtree. Programming in java and return a tree including folder structure and class structure. I have **EDIT** my question about my result. – Nick Dong Sep 27 '13 at 08:40

1 Answers1

1

Ok to browse the folder see this.

And to browse the jar (when detected) see this

Hope this helps.

Community
  • 1
  • 1
luiso1979
  • 868
  • 1
  • 6
  • 18