Finally, I wrote my own implementation.
public class FileStructure {
public final String pathName;
// or TreeMap if order matter
public HashMap<String, FileStructure> files;
public FileStructure(String path){
this.pathName = path;
files = new HashMap<String, FileStructure>();
}
}
Getting apk expension file entries with java.util.zip.ZipFile:
ZipFile zf = new ZipFile(Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/Android/obb/" + getPackageName()
+ "/main.1." + getPackageName() + ".obb");
Enumeration zipEntries = zf.entries();
String fname;
while (zipEntries.hasMoreElements()) {
fname = ((ZipEntry) zipEntries.nextElement()).getName();
addToRoot(fname, root);
}
And parse it with in FileStructure class
private void addToRoot(String fname, FileStructure root) {
String[] directories = fname.split(File.separator);
FileStructure current = root;
for (int i = 0; i < directories.length; i++) {
if (!current.files.containsKey(directories[i])) {
current.files.put(directories[i], new FileStructure(directories[i]));
}
current = current.files.get(directories[i]);
}
}
But, I will appreciate, if someone share some better solution or find defect of my implementation!