Package java.net

Examples of java.net.URLClassLoader.findResource()


                        "/WEB-INF/beans.xml",
                        "/META-INF/beans.xml",
                };

                for (String path : paths) {
                    if (loader.findResource(path) != null) return true;
                }
            } catch (Exception e) {
            }
            return false;
        }
View Full Code Here


   {
      URL docURL = di.localUrl;
      if (!di.isXML)
      {
         URLClassLoader localCL = di.localCl;
         docURL = localCL.findResource("META-INF/jboss-spring.xml");
      }
      // Validate that the descriptor was found
      if (docURL == null)
      {
         throw new DeploymentException("Failed to find META-INF/jboss-spring.xml");
View Full Code Here

            }
        }

        URLClassLoader urlLoader =
            (URLClassLoader)cmp.getClass().getClassLoader();
        URL fileLoc = urlLoader.findResource("images/" + name);
        img = cmp.getToolkit().createImage(fileLoc);

        MediaTracker tracker = new MediaTracker(cmp);
        tracker.addImage(img, 0);
        try {
View Full Code Here

          e.printStackTrace();
        }
        if (null == checker ||
        // || null != checker.findResource("java/lang/Object.class")
        // //$NON-NLS-1$
            null != checker.findResource("org/apache/uima/impl/UIMAFramework_impl.class")) { //$NON-NLS-1$
          continue;
        }
      }
      if (result.length() > 0)
        result = result.append(PATH_SEPARATOR);
View Full Code Here

                        "/WEB-INF/beans.xml",
                        "/META-INF/beans.xml",
                };

                for (String path : paths) {
                    if (loader.findResource(path) != null) return true;
                }
            } catch (Exception e) {
            }
            return false;
        }
View Full Code Here

          e.printStackTrace();
        }
        if (null == checker ||
        // || null != checker.findResource("java/lang/Object.class")
        // //$NON-NLS-1$
            null != checker.findResource("org/apache/uima/impl/UIMAFramework_impl.class")) { //$NON-NLS-1$
          continue;
        }
      }
      if (result.length() > 0)
        result = result.append(PATH_SEPARATOR);
View Full Code Here

      // We sort alphabetically to ensure deterministic order of routing types.
      Collections.sort(classFilePaths);

      for (String classFilePath : classFilePaths) {
        URL resource = loader.findResource(classFilePath);
        if (resource != null) {
          String javaName =
              classFilePath.replace('/', '.').substring(0, classFilePath.lastIndexOf(".class"));
          Class<?> dtoInterface = Class.forName(javaName, false, loader);
          if (dtoInterface.isInterface()) {
View Full Code Here

                    "/WEB-INF/beans.xml",
                    "/META-INF/beans.xml",
                };

                for (final String path : paths) {
                    final URL resource = loader.findResource(path);
                    if (resource != null) {
                        return resource;
                    }
                }
            } catch (final Exception e) {
View Full Code Here

    /**
   * Regression for Harmony-2237
   */
  public void test_getResource() throws Exception {   
    URLClassLoader urlLoader = getURLClassLoader();
    assertNull(urlLoader.findResource("XXX")); //$NON-NLS-1$
  }

  private static URLClassLoader getURLClassLoader() {
    String classPath = System.getProperty("java.class.path");
        StringTokenizer tok = new StringTokenizer(classPath, File.pathSeparator);
View Full Code Here

                    "/WEB-INF/beans.xml",
                    "/META-INF/beans.xml",
                };

                for (final String path : paths) {
                    if (loader.findResource(path) != null) {
                        return true;
                    }
                }
            } catch (final Exception e) {
                // no-op
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.