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


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

/*  571 */     ClassLoader tcl = Thread.currentThread().getContextClassLoader();
/*  572 */     URLClassLoader[] stack = ClassLoaderUtils.getClassLoaderStack(tcl);
/*  573 */     for (int s = 0; s < stack.length; s++)
/*      */     {
/*  575 */       URLClassLoader cl = stack[s];
/*  576 */       URL classURL = cl.findResource(classRsrcName);
/*  577 */       if (classURL == null)
/*      */         continue;
/*  579 */       results.append("\n\n### Instance" + count + " via UCL: " + cl + "\n");
/*  580 */       count++;
/*      */     }
View Full Code Here

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

/*  593 */     ClassLoader tcl = Thread.currentThread().getContextClassLoader();
/*  594 */     URLClassLoader[] stack = ClassLoaderUtils.getClassLoaderStack(tcl);
/*  595 */     for (int s = 0; s < stack.length; s++)
/*      */     {
/*  597 */       URLClassLoader cl = stack[s];
/*  598 */       URL classURL = cl.findResource(classRsrcName);
/*  599 */       if (classURL == null)
/*      */         continue;
/*  601 */       results.append("\n\n### Instance" + count + " via UCL: " + cl + "\n");
/*  602 */       count++;
/*      */     }
View Full Code Here

/*     */         {
/* 594 */           String[] descriptors = getDescriptorName(di);
/* 595 */           for (int n = 0; n < descriptors.length; n++)
/*     */           {
/* 597 */             String descriptor = descriptors[n];
/* 598 */             docURL = localCL.findResource(descriptor);
/* 599 */             if (docURL == null) {
/*     */               continue;
/*     */             }
/* 602 */             if (!di.url.getPath().endsWith("/"))
/*     */               break;
View Full Code Here

/* 604 */             di.watch = new URL(di.url, descriptor);
/* 605 */             this.log.debug("Updated watch URL to: " + di.watch); break;
/*     */           }
/*     */
/* 611 */           if (docURL == null) {
/* 612 */             docURL = localCL.findResource("META-INF/jboss-service.xml");
/*     */           }
/*     */         }
/* 615 */         if (docURL == null) {
/* 616 */           throw new DeploymentException("Failed to find META-INF/jboss-service.xml for archive " + di.shortName);
/*     */         }
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

      URL url = null;
      // First check for local visibility via a URLClassLoader.findResource
      if( loader instanceof URLClassLoader )
      {
         URLClassLoader ucl = (URLClassLoader) loader;
         defaultUrl = ucl.findResource(defaultsName);
         url = ucl.findResource(propertiesName);
         log.trace("findResource: "+url);
      }
      // Do a general resource search
      if( defaultUrl == null )
View Full Code Here

      // First check for local visibility via a URLClassLoader.findResource
      if( loader instanceof URLClassLoader )
      {
         URLClassLoader ucl = (URLClassLoader) loader;
         defaultUrl = ucl.findResource(defaultsName);
         url = ucl.findResource(propertiesName);
         log.trace("findResource: "+url);
      }
      // Do a general resource search
      if( defaultUrl == null )
         defaultUrl = loader.getResource(defaultsName);
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.