//throw new ServletException("Configuration file path missing! You must set a servlet init parameter whose the name is \"" + TAP_CONF_PARAMETER + "\".");
/* 2. OPEN THE CONFIGURATION FILE */
InputStreaminput=null;
// CASE: No file specified => search in the classpath for a file having the default name "tap.properties".
if(tapConfPath==null)
input=searchFile(DEFAULT_TAP_CONF_FILE,config);
else{
Filef=newFile(tapConfPath);
// CASE: The given path matches to an existing local file.
if(f.exists()){
try{
input=newFileInputStream(f);
}catch(IOExceptionioe){
thrownewServletException("Impossible to read the TAP configuration file ("+tapConfPath+")!",ioe);
}
}
// CASE: The given path seems to be relative to the servlet root directory.
else
input=searchFile(tapConfPath,config);
}
// If no file has been found, cancel the servlet loading:
if(input==null)
thrownewServletException("Configuration file not found with the path: \""+tapConfPath+"\"! Please provide a correct file path for the TAP configuration file.");
/* 3. PARSE IT INTO A PROPERTIES SET */
PropertiestapConf=newProperties();
try{
tapConf.load(input);
}catch(IOExceptionioe){
thrownewServletException("Impossible to read the TAP configuration file ("+tapConfPath+")!",ioe);