mr = smr;
} else {
// found a new charset other than iso-8859-1 -> let it load again
// as bytes (so we do not need to convert to string and back
// again)
VFSMediaResource vmr = new VFSMediaResource(vfsfile);
vmr.setEncoding(enc);
mr = vmr;
}
} else if (path.endsWith(".js")) { // a javascript library
VFSMediaResource vmr = new VFSMediaResource(vfsfile);
// set the encoding; could be null if this page starts with .js file
// (not very common...).
// if we set no header here, apache sends the default encoding
// together with the mime-type, which is wrong.
// so we assume the .js file has the same encoding as the html file
// that loads the .js file
if (g_encoding != null) vmr.setEncoding(g_encoding);
mr = vmr;
} else {
// binary data: not .html, not .htm, not .js -> treated as is
VFSMediaResource vmr = new VFSMediaResource(vfsfile);
mr = vmr;
}
}
ThreadLocalUserActivityLogger.log(FolderLoggingAction.BC_FILE_READ, getClass(), CoreLoggingResourceable.wrapBCFile(path));