If I understand correctly, you're trying to implement an ISO 7816-4 File System (or likewise).
The Java Card API does not contain a ready-to-use set of classes for these data structures, but there are some useful open source projects that you can use as starting point, for example here.
Thanks a lot for the help.
but could you explain to me with a simple example in code, how do I make this resource allocation to build a file system in java card???
Again, Java Card API does not define any kind of FileSystem class that you could just instantiate to implement such file system (with data structure, access rights, and APDU command set to use it).
However, Java Card is extensible and implementations may also embed additional standard API (e.g. SIM card - look for ETSI TS 102 241 - UICC API) or proprietary API that you could use.
If instead such API are not available, you will have to create your own and the link provided above gives some good examples how to do this.