fix the regressions introduced by the support for dynamically installing bundles

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3356 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Hugues Malphettes 2011-05-31 02:55:46 +00:00
parent c1086a2e52
commit c77624a544
1 changed files with 36 additions and 9 deletions

View File

@ -384,7 +384,7 @@ public class OSGiAppProvider extends ScanningAppProvider implements AppProvider
*/ */
public boolean isAutoInstallOSGiBundles() public boolean isAutoInstallOSGiBundles()
{ {
return getMonitoredDirResource() != null && _autoInstallOSGiBundles; return _autoInstallOSGiBundles;
} }
/** /**
@ -460,14 +460,41 @@ public class OSGiAppProvider extends ScanningAppProvider implements AppProvider
{ {
if (isAutoInstallOSGiBundles()) if (isAutoInstallOSGiBundles())
{ {
File scandir = getMonitoredDirResource().getFile(); if (getMonitoredDirResource() == null)
for (File file : scandir.listFiles()) {
{ setAutoInstallOSGiBundles(false);
if (fileMightBeAnOSGiBundle(file)) Log.info("Disable autoInstallOSGiBundles as there is not contexts folder to monitor.");
{ }
installBundle(file, false); else
} {
} File scandir = null;
try
{
scandir = getMonitoredDirResource().getFile();
if (!scandir.exists() || !scandir.isDirectory())
{
setAutoInstallOSGiBundles(false);
Log.info("Disable autoInstallOSGiBundles as the contexts folder '" + scandir.getAbsolutePath() + " does not exist.");
scandir = null;
}
}
catch (IOException ioe)
{
setAutoInstallOSGiBundles(false);
Log.info("Disable autoInstallOSGiBundles as the contexts folder '" + getMonitoredDirResource().getURI() + " does not exist.");
scandir = null;
}
if (scandir != null)
{
for (File file : scandir.listFiles())
{
if (fileMightBeAnOSGiBundle(file))
{
installBundle(file, false);
}
}
}
}
} }
super.doStart(); super.doStart();
if (isAutoInstallOSGiBundles()) if (isAutoInstallOSGiBundles())