Assets
|-man
| |-myhtml.html
|
|-women
| |-myhtml.html
this is my folder structure some times i need to check the file exist in men some times i need to check the file exist in women what can i do.
try {
fileExist = Arrays.asList(getResources().getAssets().list("")).contains(pathInAssets);
} catch (FileNotFoundException e) {
fileExist = false;
} catch (IOException e) {
e.printStackTrace();
}
this give only the list man and women i cant go inside it and check the existance.
Is their any other way to check this
Just open an input stream for the file. As if you were going to read the file.
If you manage to open it the file does exist. Otherwise you get an exception.