Search in sources :

Example 1 with ExternalProvider

use of com.genexus.db.driver.ExternalProvider in project JavaClasses by genexuslabs.

the class Application method getExternalProviderImpl.

private static ExternalProvider getExternalProviderImpl(String service) {
    ExternalProvider externalProviderImpl = null;
    GXService providerService = getGXServices().get(service);
    if (providerService != null) {
        Class providerClass;
        try {
            providerClass = Class.forName(providerService.getClassName());
        } catch (ClassNotFoundException e) {
            logger.fatal("Unrecognized External Provider class (ClassNotFound) : " + providerService.getName() + " / " + providerService.getClassName(), e);
            throw new InternalError("Unrecognized External Provider class (ClassNotFound) : " + providerService.getName() + " / " + providerService.getClassName());
        }
        try {
            externalProviderImpl = (ExternalProvider) providerClass.getConstructor(String.class).newInstance(service);
        } catch (Exception e) {
            logger.fatal("Unable to Initialize External Provider Class: " + providerService.getClassName(), e);
            throw new InternalError("Unable to Initialize External Provider Class: " + providerService.getClassName(), e);
        }
    }
    return externalProviderImpl;
}
Also used : ExternalProvider(com.genexus.db.driver.ExternalProvider) GXService(com.genexus.util.GXService) IOException(java.io.IOException) SQLException(java.sql.SQLException)

Example 2 with ExternalProvider

use of com.genexus.db.driver.ExternalProvider in project JavaClasses by genexuslabs.

the class GXExternalFileInfo method listFiles.

@Override
public GXFileCollection listFiles(String filter, Object prov, String name) {
    ExternalProvider provider = (ExternalProvider) prov;
    GXFileCollection files = new GXFileCollection();
    for (String file : (filter != null) ? provider.getFiles(name, filter) : provider.getFiles(name)) {
        files.add(new GXFile(new com.genexus.util.GXExternalFileInfo(file, provider)));
    }
    return files;
}
Also used : IExtensionGXExternalFileInfo(com.genexus.common.interfaces.IExtensionGXExternalFileInfo) ExternalProvider(com.genexus.db.driver.ExternalProvider) GXFileCollection(com.genexus.util.GXFileCollection) GXFile(com.genexus.util.GXFile)

Aggregations

ExternalProvider (com.genexus.db.driver.ExternalProvider)2 IExtensionGXExternalFileInfo (com.genexus.common.interfaces.IExtensionGXExternalFileInfo)1 GXFile (com.genexus.util.GXFile)1 GXFileCollection (com.genexus.util.GXFileCollection)1 GXService (com.genexus.util.GXService)1 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1