use of org.flywaydb.core.internal.util.scanner.classpath.jboss.JBossVFSv3ClassPathLocationScanner in project flyway by flyway.
the class ClassPathScanner method createLocationScanner.
/**
* Creates an appropriate location scanner for this url protocol.
*
* @param protocol The protocol of the location url to scan.
* @return The location scanner or {@code null} if it could not be created.
*/
private ClassPathLocationScanner createLocationScanner(String protocol) {
if (locationScannerCache.containsKey(protocol)) {
return locationScannerCache.get(protocol);
}
if ("file".equals(protocol)) {
FileSystemClassPathLocationScanner locationScanner = new FileSystemClassPathLocationScanner();
locationScannerCache.put(protocol, locationScanner);
resourceNameCache.put(locationScanner, new HashMap<URL, Set<String>>());
return locationScanner;
}
if ("jar".equals(protocol) || "war".equals(protocol) || //WebLogic
"zip".equals(protocol) || //WebSphere
"wsjar".equals(protocol)) {
JarFileClassPathLocationScanner locationScanner = new JarFileClassPathLocationScanner();
locationScannerCache.put(protocol, locationScanner);
resourceNameCache.put(locationScanner, new HashMap<URL, Set<String>>());
return locationScanner;
}
FeatureDetector featureDetector = new FeatureDetector(classLoader);
if (featureDetector.isJBossVFSv3Available() && "vfs".equals(protocol)) {
JBossVFSv3ClassPathLocationScanner locationScanner = new JBossVFSv3ClassPathLocationScanner();
locationScannerCache.put(protocol, locationScanner);
resourceNameCache.put(locationScanner, new HashMap<URL, Set<String>>());
return locationScanner;
}
if (featureDetector.isOsgiFrameworkAvailable() && (// Felix
"bundle".equals(protocol) || //Equinox
"bundleresource".equals(protocol))) {
OsgiClassPathLocationScanner locationScanner = new OsgiClassPathLocationScanner();
locationScannerCache.put(protocol, locationScanner);
resourceNameCache.put(locationScanner, new HashMap<URL, Set<String>>());
return locationScanner;
}
return null;
}
Aggregations