Code example for URL

Methods: toURI

0
      final URL resource = classLoader.getResource(".kettle-plugin-directory-marker");
      if (resource != null)
      { 
        try 
        { 
          final File f = new File(resource.toURI());
          final File parentFile = f.getParentFile();
          if (parentFile != null)
          { 
            final File pluginsParent = parentFile.getParentFile();
            if (pluginsParent != null)
            { 
              final String absPath = pluginsParent.getAbsolutePath();
              System.setProperty("DI_HOME", absPath);
            } 
          } 
        } 
        catch (URISyntaxException e)
        { 
          logger.debug("Failed to add reporting plugin " + resource, e);
        }