Codota Logo
ClassLoaderUtils
Code IndexAdd Codota to your IDE (free)

How to use
ClassLoaderUtils
in
no.difi.oxalis.commons.filesystem

Best Java code snippets using no.difi.oxalis.commons.filesystem.ClassLoaderUtils (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: difi/oxalis

  @Provides
  @Singleton
  @Named("plugin")
  public ClassLoader providesClassLoader(@Named("home") Path homeDirectory, Settings<FileSystemConf> settings) {
    final Path pluginPath = settings.getPath(FileSystemConf.PLUGIN, homeDirectory);
    log.info("Loading plugins from '{}'.", pluginPath);
    return ClassLoaderUtils.initiate(pluginPath);
  }
}
origin: no.difi.oxalis/oxalis-commons

    findJarFiles(path),
    Thread.currentThread().getContextClassLoader()
);
origin: no.difi.oxalis/oxalis-commons

  @Provides
  @Singleton
  @Named("plugin")
  public ClassLoader providesClassLoader(@Named("home") Path homeDirectory, Settings<FileSystemConf> settings) {
    final Path pluginPath = settings.getPath(FileSystemConf.PLUGIN, homeDirectory);
    log.info("Loading plugins from '{}'.", pluginPath);
    return ClassLoaderUtils.initiate(pluginPath);
  }
}
origin: difi/oxalis

    findJarFiles(path),
    Thread.currentThread().getContextClassLoader()
);
origin: difi/oxalis

private ConnectionFactory createConnectionFactory(boolean profileSql) throws MalformedURLException,
    ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException {
  Path jdbcDriverClassPath = settings.getPath(PersistenceConf.DRIVER_PATH, homeFolder);
  ClassLoader classLoader = ClassLoaderUtils.initiate(jdbcDriverClassPath);
  String jdbcDriverClassName = settings.getString(PersistenceConf.DRIVER_CLASS);
  URI connectURI = URI.create(settings.getString(PersistenceConf.JDBC_CONNECTION_URI)); // + "?initialTimeout=2";
  String userName = settings.getString(PersistenceConf.JDBC_USERNAME);
  String password = settings.getString(PersistenceConf.JDBC_PASSWORD);
  Class<?> aClass;
  try {
    aClass = Class.forName(jdbcDriverClassName, true, classLoader);
  } catch (ClassNotFoundException e) {
    throw new IllegalStateException(String.format(
        "Unable to locate class '%s' in class path '%s'", jdbcDriverClassName, jdbcDriverClassPath));
  }
  Driver driver = (Driver) aClass.newInstance();
  assertTrue(driver.acceptsURL(connectURI.toString()));
  Properties properties = new Properties();
  properties.put("user", userName);
  properties.put("password", password);
  if (profileSql) {
    properties.put("profileSQL", "true");       // MySQL debug option
  }
  return new DriverConnectionFactory(driver, connectURI.toString(), properties);
}
origin: no.difi.oxalis/oxalis-persistence

ClassLoader classLoader = ClassLoaderUtils.initiate(jdbcDriverClassPath);
origin: difi/oxalis

ClassLoader classLoader = ClassLoaderUtils.initiate(jdbcDriverClassPath);
origin: difi/oxalis

@Test
public void testBasicDataSource() throws Exception {
  Path jdbcDriverClassPath = settings.getPath(PersistenceConf.DRIVER_PATH, homeFolder);
  ClassLoader classLoader = ClassLoaderUtils.initiate(jdbcDriverClassPath);
  BasicDataSource basicDataSource = new BasicDataSource();
  basicDataSource.setDriverClassName(settings.getString(PersistenceConf.DRIVER_CLASS));
  basicDataSource.setUrl(settings.getString(PersistenceConf.JDBC_CONNECTION_URI));
  basicDataSource.setUsername(settings.getString(PersistenceConf.JDBC_USERNAME));
  basicDataSource.setPassword(settings.getString(PersistenceConf.JDBC_PASSWORD));
  // Does not work in 1.4, fixed in 1.4.1
  basicDataSource.setDriverClassLoader(classLoader);
  try {
    Connection connection = basicDataSource.getConnection();
    assertNotNull(connection);
  } catch (SQLException e) {
    // As expected when using DBCP 1.4
  }
}
no.difi.oxalis.commons.filesystemClassLoaderUtils

Javadoc

Util class used to support use of class loader in Oxalis.

Most used methods

  • initiate
    Inititiates a ClassLoader from Path. Behaviour changes based upon input: * Path is `null` - Returns
  • findJarFiles

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getExternalFilesDir (Context)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now