I am already trying for over an hour and cant figure out the right way to do it, although it is probably pretty easy:
I have something like this : foo/bar/test
foo/bar/test
String path ="AnyDirectory/subFolder/last.htm"; int pos = path.lastIndexOf("/") + 1; path.substring(pos, path.length()-pos) ;
Now you have the last.htm in the path string.