fileInfo.refresh();
}
protected FileInfo getFileInfo() throws IOException {
try {
FileInfo fileInfo = Editor.this.createFileInfo(prefix + filePath);
FileObject file = fileInfo.getFile();
String contentType = (String) attributes.get("content-type");
if (file.getType().hasChildren()) {
String extension;
if (contentType != null) {
extension = Editor.this.findExtensionByMimeType(contentType);
if (extension == null) extension = Editor.this.getDefaultExtension();
} else {
extension = Editor.this.getDefaultExtension();
}
String name = "index";
String defaultIndex = (String) file.getContent().getAttribute("default-index");
if (defaultIndex != null) name = defaultIndex;
FileObject base = file;
file = base.resolveFile(name);
if (file.exists()) {
fileInfo = Editor.this.createFileInfo(file.getName().getPath());
} else {
if (extension != null && extension.length() > 0) {
file = base.resolveFile(name + '.' + extension);
fileInfo = Editor.this.createFileInfo(file.getName().getPath());
}
}
} else {
if (file.getName().getExtension().length() == 0) {
// no extension
String extension;
if (contentType == null && !servletContext.getContainer().getDefaultMimeType().equals(fileInfo.getContentType())) {
contentType = (String) fileInfo.getAttribute("content-type");
}
if (contentType != null) {
extension = Editor.this.findExtensionByMimeType(contentType);
if (extension == null) extension = Editor.this.getDefaultExtension();
} else {