return entries;
String[] names = file.list();
Arrays.sort(names); // Sort alphabetically
if (names == null)
return entries;
NamingEntry entry = null;
for (int i = 0; i < names.length; i++) {
// START S1AS8PE 4965170
File currentFile = (File)fileCache.get(names[i]);
if ( currentFile == null ) {
currentFile = new File(file, names[i]);
fileCache.put(names[i],currentFile);
}
// END S1AS8PE 4965170
Object object = null;
if (currentFile.isDirectory()) {
FileDirContext tempContext = new FileDirContext(env);
tempContext.setDocBase(file.getPath());
tempContext.setAllowLinking(getAllowLinking());
tempContext.setCaseSensitive(isCaseSensitive());
object = tempContext;
} else {
object = new FileResource(currentFile);
}
entry = new NamingEntry(names[i], object, NamingEntry.ENTRY);
entries.addElement(entry);
}
return entries;