Package org.apache.tools.ant.types.resources

Examples of org.apache.tools.ant.types.resources.URLResource


         String ciListener = configuration.getPlayer().equals("flash") ? CI_LISTENER : AIR_CI_LISTENER;
        
         File runner = new File(workingDir.getAbsolutePath() + File.separatorChar + TESTRUNNER_FILE);
        
         //Template location in JAR
         URLResource template = new URLResource(getClass().getResource("/" + TESTRUNNER_TEMPLATE));
        
         //Create tokens to filter
         FilterSet filters = new FilterSet();
         filters.addFilter("APPLICATION_PREFIX", applicationPrefix);
         filters.addFilter("APPLICATION_CLASS", applicationClass);
View Full Code Here


   private void createApplicationDescriptor()
   {
      try
      {
         //Template location in JAR
         URLResource template = new URLResource(getClass().getResource("/" + DESCRIPTOR_TEMPLATE));

         //Descriptor location, same location as SWF due to relative path required in descriptor
         File descriptor = new File(getSwf().getParentFile().getAbsolutePath() + File.separatorChar + DESCRIPTOR_FILE);

         //Create tokens to filter
View Full Code Here

   */
  @Override protected Resource getStylesheet() {
    String xslname = "junit-frames.xsl";
    if (NOFRAMES.equals(format)) xslname = "junit-noframes.xsl";
    if (styleDir == null) {
      URLResource stylesheet = new URLResource();
      URL stylesheetURL = getClass().getClassLoader().getResource(concat(XSL_FILE_PATH, xslname));
      stylesheet.setURL(stylesheetURL);
      return stylesheet;
    }
    FileResource stylesheet = new FileResource();
    File stylesheetFile = new File(styleDir, xslname);
    stylesheet.setFile(stylesheetFile);
    return stylesheet;
  }
View Full Code Here

            xslname = "junit-noframes.xsl";
        }
        if (styleDir == null) {
            // If style dir is not specified we have to retrieve
            // the stylesheet from the classloader
            URLResource stylesheet = new URLResource();
            URL stylesheetURL = getClass().getClassLoader().getResource(
                    "org/apache/tools/ant/taskdefs/optional/junit/xsl/" + xslname);
            stylesheet.setURL(stylesheetURL);
            return stylesheet;
        }
        // If we are here, then the style dir is here and we
        // should read the stylesheet from the filesystem
        FileResource stylesheet = new FileResource();
        File stylesheetFile = new File(styleDir, xslname);
        stylesheet.setFile(stylesheetFile);
        return stylesheet;
    }
View Full Code Here

            }
            // maybe this import tasks is inside an imported URL?
            try {
                URL buildFileURL = new URL(getLocation().getFileName());
                URL importedFile = new URL(buildFileURL, file);
                return new URLResource(importedFile);
            } catch (MalformedURLException ex) {
                log(ex.toString(), Project.MSG_VERBOSE);
            }
            throw new BuildException("failed to resolve " + file
                                     + " relative to "
View Full Code Here

     * Set an URL to get.
     *
     * @param u URL for the file.
     */
    public void setSrc(URL u) {
        add(new URLResource(u));
    }
View Full Code Here

                "Unable to find " + antlibUrl, ex);
        }
        ComponentHelper helper =
            ComponentHelper.getComponentHelper(project);
        helper.enterAntLib(uri);
        URLResource antlibResource = new URLResource(antlibUrl);
        try {
            // Should be safe to parse
            ProjectHelper parser = null;
            Object p =
                project.getReference(ProjectHelper.PROJECTHELPER_REFERENCE);
View Full Code Here

     * Set an URL to get.
     *
     * @param u URL for the file.
     */
    public void setSrc(URL u) {
        add(new URLResource(u));
    }
View Full Code Here

    @Test
    public void testurloutput() throws IOException {
        File f = project.resolveFile("testurloutput");
        try {
            FILE_UTILS.createNewFile(f);
            testoutput(new URLResource(f));
            fail("should have caught UnknownServiceException");
        } catch (UnknownServiceException e) {
            //TODO assert exception message
        } finally {
            if (!f.delete()) {
View Full Code Here

            }
            // maybe this import tasks is inside an imported URL?
            try {
                URL buildFileURL = new URL(getLocation().getFileName());
                URL importedFile = new URL(buildFileURL, file);
                return new URLResource(importedFile);
            } catch (MalformedURLException ex) {
                log(ex.toString(), Project.MSG_VERBOSE);
            }
            throw new BuildException("failed to resolve " + file
                                     + " relative to "
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.resources.URLResource

Copyright © 2018 www.massapicom. 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.