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:
parent
c1086a2e52
commit
c77624a544
|
@ -384,7 +384,7 @@ public class OSGiAppProvider extends ScanningAppProvider implements AppProvider
|
|||
*/
|
||||
public boolean isAutoInstallOSGiBundles()
|
||||
{
|
||||
return getMonitoredDirResource() != null && _autoInstallOSGiBundles;
|
||||
return _autoInstallOSGiBundles;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -460,14 +460,41 @@ public class OSGiAppProvider extends ScanningAppProvider implements AppProvider
|
|||
{
|
||||
if (isAutoInstallOSGiBundles())
|
||||
{
|
||||
File scandir = getMonitoredDirResource().getFile();
|
||||
for (File file : scandir.listFiles())
|
||||
{
|
||||
if (fileMightBeAnOSGiBundle(file))
|
||||
{
|
||||
installBundle(file, false);
|
||||
}
|
||||
}
|
||||
if (getMonitoredDirResource() == null)
|
||||
{
|
||||
setAutoInstallOSGiBundles(false);
|
||||
Log.info("Disable autoInstallOSGiBundles as there is not contexts folder to monitor.");
|
||||
}
|
||||
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();
|
||||
if (isAutoInstallOSGiBundles())
|
||||
|
|
Loading…
Reference in New Issue