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


        // TODO Auto-generated catch block
        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);
      result = result.append(classPath);
    }
View Full Code Here

   @CoberturaIgnore
   public void printVersion() {
      String version = String.format("\nstubby4j v%s", "x.x.xx");
      final URLClassLoader classLoader = (URLClassLoader) getClass().getClassLoader();
      try {
         final URL url = classLoader.findResource("META-INF/MANIFEST.MF");
         final Manifest manifest = new Manifest(url.openStream());
         final String rawVersion = manifest.getMainAttributes().getValue("Implementation-Version");
         version = String.format("\nstubby4j v%s", rawVersion);
      } catch (Exception e) {
         //Do nothing
View Full Code Here

      }
      Set tmp = classLoaders;
      for (Iterator iter = tmp.iterator(); iter.hasNext();)
      {
         URLClassLoader cl = (URLClassLoader) iter.next();
         URL classURL = cl.findResource(classRsrcName);
         if (classURL != null)
         {
            results.append("\n\n### Instance" + count + " found in UCL: " + cl + "\n");
            count++;
         }
View Full Code Here

      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      URLClassLoader[] stack = ClassLoaderUtils.getClassLoaderStack(tcl);
      for (int s = 0; s < stack.length; s++)
      {
         URLClassLoader cl = stack[s];
         URL classURL = cl.findResource(classRsrcName);
         if (classURL != null)
         {
            results.append("\n\n### Instance" + count + " via UCL: " + cl + "\n");
            count++;
         }
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

   }

   public InteropClientConfig createClientConfig()
   {
      URLClassLoader ctxLoader = (URLClassLoader)Thread.currentThread().getContextClassLoader();
      URL scenariosDescriptor = ctxLoader.findResource("META-INF/scenarios.xml");
      if(scenariosDescriptor!=null)
      {
         try
         {
            Element configRoot = DOMUtils.parse( scenariosDescriptor.openStream() );
View Full Code Here

      };
     
      Thread.currentThread().setContextClassLoader(urlLoader);
      try
      {
         URL configURL = urlLoader.findResource("META-INF/standard-jaxrpc-client-config.xml");
         assertTrue("Invalid config url: " + configURL, configURL.toExternalForm().indexOf("jbws1653") > 0);

         InitialContext iniCtx = getInitialContext();
         Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
         TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
View Full Code Here

               // Check the suffix to descriptor mapping
               String[] descriptors = getDescriptorName(di);
               for(int n = 0; n < descriptors.length; n ++)
               {
                  String descriptor = descriptors[n];
                  docURL = localCL.findResource(descriptor);
                  if( docURL != null )
                  {
                     // If this is a unpacked deployment, update the watch url
                     if (di.url.getPath().endsWith("/"))
                     {
View Full Code Here

                     break;
                  }
               }
               // No descriptors, use the default META-INF/jboss-service.xml
               if( docURL == null )
                  docURL = localCL.findResource(JBOSS_SERVICE);
            }
            // Validate that the descriptor was found
            if (docURL == null)
               throw new DeploymentException("Failed to find META-INF/jboss-service.xml for archive " + di.shortName);
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.