if(paths.isEmpty()){ | if(paths.isEmpty()){ | ||||
return false; | return false; | ||||
} | } | ||||
int idx = file.lastIndexOf("/"); | |||||
return idx == -1 ? false : paths.contains(file.substring(0,idx)); | |||||
String path=file; | |||||
final Set<String> dirs = new HashSet<String>(); | |||||
while(true){ | |||||
int idx = path.lastIndexOf("/"); | |||||
if( idx> 0 ){ | |||||
path=file.substring(0,idx); | |||||
if(paths.contains(path)){ | |||||
paths.addAll(dirs); | |||||
return true; | |||||
} | |||||
dirs.add(path); | |||||
}else{ | |||||
break; | |||||
} | |||||
return idx == -1 ? false : ; | |||||
} | |||||
return false; | |||||
} | } | ||||
/** | /** |