Package java.net

Examples of java.net.URL.toURI()


  public String[] listEntries(URI uri) throws IOException {
    try {
      URL res = clazz.getResource(getPath(uri));
      if(res == null)
        throw new FileNotFoundException(getPath(uri));
      return registry.listEntries(res.toURI());
    } catch (URISyntaxException e) {
      throw new IOException(e.getMessage(), e);
    }
  }
 
View Full Code Here


  public URI getResourceURI(URI uri) throws IOException {
    try {
      URL res = clazz.getResource(getPath(uri));
      if(res == null)
        throw new FileNotFoundException(getPath(uri));
      return res.toURI();
    } catch (URISyntaxException e) {
      throw new IOException(e.getMessage(), e);
    }
  }
 
View Full Code Here

   
    protected File rootDir() {
        File curDir;
        URL url = getClass().getResource(".");
        try {
            curDir = new File(url.toURI());
        } catch (URISyntaxException e) {
            curDir = new File(url.getPath());
        }
        return new File(curDir.getParentFile().getParentFile(), "public");
    }
View Full Code Here

            {
                URL url = getClass().getResource("/ext/gosh_profile");
                if (url == null) {
                    url = getClass().getResource("/gosh_profile");
                }
                uri = (url == null) ? null : url.toURI();
            }
            if (uri != null)
            {
                source(session, uri.toString());
            }
View Full Code Here

    URL pluginBaseURL = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory();
   
    File pluginBaseFile;
   
    try {
      pluginBaseFile = new File(pluginBaseURL.toURI());
    } catch (URISyntaxException e) {
      pluginBaseFile = new File(pluginBaseURL.getPath());
    }
   
    return pluginBaseFile.getAbsolutePath();
View Full Code Here

    String pluginImageDir = pluginBaseDir + Const.FILE_SEPARATOR + "images" + Const.FILE_SEPARATOR;

    URL pluginBaseURL = PluginRegistry.getInstance().findPluginWithId(StepPluginType.class, "TypeExitRubyStep").getPluginDirectory();

    try {
      pluginBaseFile = new File(pluginBaseURL.toURI());
    } catch (URISyntaxException e) {
      pluginBaseFile = new File(pluginBaseURL.getPath());
    }

    try {
View Full Code Here

    String minMemOption = "-Xms256m";
    String maxMemOption = "-Xmx" + prefs.getMaxMem() + "m";

    String classpath = File.separator + "lib" + File.separator + JWFILDFIRE_JAR;
    URL launcherURL = ((URLClassLoader) this.getClass().getClassLoader()).getURLs()[0];
    File currentDir = new File(launcherURL.toURI());

    String javaCmd = java.getAbsolutePath();
    if (javaCmd.indexOf(" ") >= 0) {
      javaCmd = "\"" + javaCmd + "\"";
    }
View Full Code Here

    }
   
    @Test
    public void testNotArchivingEmptyResults() throws InterruptedException, IOException, URISyntaxException, ComponentConfigurationException {
        URL resource = SurefireArchiverUnitTest.class.getResource("/surefire-archiver-test1");
        File reportsDir = new File(resource.toURI().getPath());
        doReturn(reportsDir).when(this.mojoInfo).getConfigurationValue("reportsDirectory", File.class);
       
        this.archiver.postExecute(buildProxy, null, this.mojoInfo, new NullBuildListener(), null);
       
        SurefireReport action = this.build.getAction(SurefireReport.class);
View Full Code Here

    }
   
    @Test
    public void testArchiveResults() throws InterruptedException, IOException, URISyntaxException, ComponentConfigurationException {
        URL resource = SurefireArchiverUnitTest.class.getResource("/surefire-archiver-test2");
        File reportsDir = new File(resource.toURI().getPath());
        doReturn(reportsDir).when(this.mojoInfo).getConfigurationValue("reportsDirectory", File.class);
        touchReportFiles(reportsDir);
       
        this.archiver.postExecute(buildProxy, null, this.mojoInfo, new NullBuildListener(), null);
       
View Full Code Here

        Assert.assertNotNull(result);
        Assert.assertEquals(2658, result.getTotalCount());
       
       
        resource = SurefireArchiverUnitTest.class.getResource("/surefire-archiver-test3");
        reportsDir = new File(resource.toURI().getPath());
        doReturn(reportsDir).when(this.mojoInfo).getConfigurationValue("reportsDirectory", File.class);
        touchReportFiles(reportsDir);
       
        this.archiver.postExecute(buildProxy, null, this.mojoInfo, new NullBuildListener(), null);
       
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.