if (importer instanceof ExcelImporter) {
URL url = null;
if (_src.startsWith("/")) {// try to load by application
// context.
WebApp wapp = Executions.getCurrent().getDesktop().getWebApp();
String path = wapp.getRealPath(_src);
if (path != null) {
File file = new File(path);
// if (file.isDirectory())
// throw new IllegalArgumentException("Your input source is a directory, not a vaild file");
if (file.exists())
url = file.toURI().toURL();
} else
url = wapp.getResource(_src);
}
if (url == null) {// try to load from class loader
url = new ClassLocator().getResource(_src);
}
if (url == null) {// try to load from file