Package java.io

Examples of java.io.File.toURL()


    // second channel
    inpFile = new File(getDataDir(), "pro-linux.rdf");
    ChannelIF chB = reg.addChannel(inpFile.toURL(), 2, true);
    // third channel
    inpFile = new File(getDataDir(), "snipsnap-org.rss");
    ChannelIF chC = reg.addChannel(inpFile.toURL(), 2, true);
    // some basic assertions
    assertEquals("channel exists", 3, reg.getChannels().size());
    assertTrue("channel A", reg.getChannels().contains(chA));
    assertTrue("channel B", reg.getChannels().contains(chB));
    assertTrue("channel C", reg.getChannels().contains(chC));
View Full Code Here


    File inpFile = new File(getDataDir(), "xmlhack-0.91.xml");
    File chFile = new File(getOutputDir(), "xmlhack-0.91.xml");
    synchronized(chFile) {
      FileUtils.copyFile(inpFile, chFile);
    }
    ChannelIF chA = reg.addChannel(chFile.toURL(), 2 /* secs */, true);
    // be sure channel is read in
    try {
      Thread.sleep(2500);
    } catch (InterruptedException e) {
      logger.warn("Interrupted waiting thread");
View Full Code Here

    super("TestOPML_1_1_Parser", name);
    if (feeds == null) {
      File inpFile = new File(getDataDir(), "favchannels.opml");
      feeds = OPMLParser.parse(inpFile);
      // for later reference
      inpURL = inpFile.toURL();
    }
  }

  public void testNumberFeedsReadIn() {
    assertEquals(19, feeds.size());
View Full Code Here

    super("TestRSS_0_91_Parser", name);
    if (channel == null) {
      File inpFile = new File(getDataDir(), "xmlhack-0.91.xml");
      channel = FeedParser.parse(new ChannelBuilder(), inpFile);
      // for later reference
      inpURL = inpFile.toURL();
    }
  }

  public void testCreatedChannel() {
    assertEquals("xmlhack", channel.getTitle());
View Full Code Here

      File wsdlFile = new File("resources/webservice/jbws309/META-INF/wsdl/OrganizationService.wsdl");
      assertTrue("wsdl file exists", wsdlFile.exists());

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(wsdlFile.toURL(), new QName(nsURI, "OrganizationService"));
      Call call = service.createCall(new QName(nsURI, "BasicSecuredPort"), "getContactInfo");
      call.setTargetEndpointAddress(targetAddress);

      try
      {
View Full Code Here

      this.warURL = warURL;
      String path = warURL.getFile();
      File classesDir = new File(path, "WEB-INF/classes");
      if (classesDir.exists())
      {
         ctxLoader.addURLInternal(classesDir.toURL());
      }
      File libDir = new File(path, "WEB-INF/lib");
      if (libDir.exists())
      {
         File[] jars = libDir.listFiles();
View Full Code Here

         for (int j = 0; j < length; j++)
         {
            File jar = jars[j];
            if(jar.getAbsolutePath().endsWith(".jar"))
            {
               ctxLoader.addURLInternal(jar.toURL());
            }
         }
      }
   }
View Full Code Here

                continue;
            try {
                File file = new File(cp);
                //buffer.append(file.toURL().toString()); //before(bug)
                //BugFix: The file url for java.rmi.server.codebase was not correct generated (file:///)
                String url = file.toURL().toString();
                String fileUrl = url.substring(0, url.indexOf('/'));
                String codebase = fileUrl + "//" + url.substring(url.indexOf('/'), url.length());
                buffer.append(codebase);
                buffer.append(' ');
            } catch (MalformedURLException e) {
View Full Code Here

      File deployment = new File(deploymentName);
      if (deployment.exists() && deployment.delete() == false)
         throw new IOException("Cannot delete existing deployment: " + deployment);

      tmpFile.renameTo(deployment);
      moduleInfo.setModuleID(deployment.toURL());
      return moduleInfo;
   }

   /**
    * A simple module type determination taking only the descriptor name into account.
View Full Code Here

         File child = files[n];
         // Ignore the server tmp directory
         if( child.isDirectory() && child.getName().equals("tmp") == false )
            buildJarSet(child, jarFiles);
         else if( child.getName().endsWith(".jar") )
            jarFiles.add(child.toURL());
      }
   }

   /**
    * Build a TreeMap of the class name to ClassVersionInfo
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.