List of utility methods to do ClassLoader
Matcher | hasLogDatePatternMatcher(final String line) Implementation Routine hasLogDatePatternMatcher. final Matcher mSysOut = PAT_SYS_OUT_LOG.matcher(line); final boolean chk1 = mSysOut.find(); if (chk1) { return mSysOut; final Matcher mLog4j = PAT_LOG4J.matcher(line); final boolean chk2 = mLog4j.find(); if (chk2) { ... |
boolean | isExist(String path) is Exist return getResourceUrl(path) != null;
|
boolean | isVMAlive(String procId) is VM Alive if (procId == null || "".equals(procId)) { return false; initJVMToolJarClassLoader(); try { Object vm = method_AttachToVM.invoke(null, procId); if (vm != null) { return true; ... |
Properties | load(File propsFile) load Properties props = new Properties(); FileInputStream fis = new FileInputStream(propsFile); props.load(fis); fis.close(); return props; |
Properties | load(final String filename) Load a properties file from the classpath final Properties props = new Properties(); final URL url = ClassLoader.getSystemResource(filename); if (url != null) { try { props.load(url.openStream()); } catch (final IOException e) { e.printStackTrace(); props.put("stamp", "loading from url " + url + " for " + filename + " failed " + e); ... |
Properties | load(String propertiesName) Utility to load a properties file from the classpath. Properties p = new Properties(); URL url = ClassLoader.getSystemResource(propertiesName); if (url == null) { throw new FileNotFoundException("Properties file not on classpath: " + propertiesName); InputStream is = url.openStream(); try { p.load(is); ... |
Properties | load(String propsName) Load a properties file from the classpath. Properties props = new Properties(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource(propsName); props.load(url.openStream()); return props; |
Class | loadAttachApi() Loads the com.sun.tools.attach.VirtualMachine class as the entry point to the attach API. File toolsJar = locateToolsJar(); ClassLoader cl = wrapIntoClassLoader(toolsJar); try { return cl.loadClass("com.sun.tools.attach.VirtualMachine"); } catch (ClassNotFoundException e) { throw new IllegalStateException("Unable to find com.sun.tools.attach.VirtualMachine", e); |
Properties | loadCorrectedConfiguration(String configurationFilename) load Corrected Configuration try { String configsDataDir = System.getProperty("repox.data.dir"); String configurationFile; if (configDataDirAlreadyExists(configsDataDir, configurationFilename)) configurationFile = URLDecoder.decode(configsDataDir + File.separator + configurationFilename, "ISO-8859-1"); else { URL configurationURL = Thread.currentThread().getContextClassLoader() ... |
File | loadFile(String file) load File URL fileURL = Thread.currentThread().getContextClassLoader().getResource(file); if (fileURL == null) { throw new FileNotFoundException(file); return new File(fileURL.toURI()); |