Package java.io

Examples of java.io.File.toURL()


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

  public void testCreatedChannel() {
    assertEquals("SourceForge.net: SF.net Project News: RSS Library for Java",
View Full Code Here


         {
            File dir = new File(bootURL.getFile());
            if (dir.exists())
            {
               // Add the local file patch directory
               urls.add(dir.toURL());

               // Add the contents of the directory too
               File[] jars = dir.listFiles(new JarFilter());

               for (int j = 0; jars != null && j < jars.length; j++)
View Full Code Here

         url = new URL(urlspec);
         if (url.getProtocol().equals("file"))
         {
            // make sure the file is absolute & canonical file url
            File file = new File(url.getFile()).getCanonicalFile();
            url = file.toURL();
         }
      }
      catch (Exception e)
      {
         // make sure we have a absolute & canonical file url
View Full Code Here

      {
         // make sure we have a absolute & canonical file url
         try
         {
            File file = new File(urlspec).getCanonicalFile();
            url = file.toURL();
         }
         catch (Exception n)
         {
            throw new MalformedURLException(n.toString());
         }
View Full Code Here

      // try to canonicalize the strings a bit.
      File file = new File(deployFile, filename);
      if (file.exists())
      {
         staticLog.debug(file.getAbsolutePath() + " is a valid file");
         return file.toURL();
      }
      else
      {
         staticLog.debug("File does not exist, creating url: " + deployFile);
         return new URL(deployFile.toURL(), filename);
View Full Code Here

      if (url == null)
      {
         File file = new File(archive);
         if (file.exists())
            url = file.toURL();
      }

      if (url == null)
      {
         File file = new File("lib/" + archive);
View Full Code Here

      if (url == null)
      {
         File file = new File("lib/" + archive);
         if (file.exists())
            url = file.toURL();
      }

      if (url == null)
         throw new IllegalArgumentException("Cannot obtain URL for: " + archive+", cwd="+new File(".").getAbsolutePath());
View Full Code Here

    super("TestFormatDetector", name);
  }

  public void testFormatRSS091xmlhack() throws Exception {
    File inpFile = new File(getDataDir(), "xmlhack-0.91.xml");
    ChannelFormat actualFormat = FormatDetector.getFormat(inpFile.toURL());
    assertEquals(ChannelFormat.RSS_0_91, actualFormat);
  }
 
  public void testFormatRSS091aeden() throws Exception {
    File inpFile = new File(getDataDir(), "aeden.rss");
View Full Code Here

    assertEquals(ChannelFormat.RSS_0_91, actualFormat);
  }
 
  public void testFormatRSS091aeden() throws Exception {
    File inpFile = new File(getDataDir(), "aeden.rss");
    ChannelFormat actualFormat = FormatDetector.getFormat(inpFile.toURL());
    assertEquals(ChannelFormat.RSS_0_91, actualFormat);
  }
 
  public void testFormatRSS092gratefuldead() throws Exception {
    File inpFile = new File(getDataDir(), "gratefulDead-rss-0.92.xml");
View Full Code Here

    assertEquals(ChannelFormat.RSS_0_91, actualFormat);
  }
 
  public void testFormatRSS092gratefuldead() throws Exception {
    File inpFile = new File(getDataDir(), "gratefulDead-rss-0.92.xml");
    ChannelFormat actualFormat = FormatDetector.getFormat(inpFile.toURL());
    assertEquals(ChannelFormat.RSS_0_92, actualFormat);
  }
 
  public void testFormatRSS10xmlhack() throws Exception {
    File inpFile = new File(getDataDir(), "xmlhack-1.0.xml");
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.