Package java.io

Examples of java.io.File.toURI()


    /* 2.) Check if ImageDescriptor exists in File System */
    File favicon = getImageFile(bookmark.getId());
    if (favicon.exists()) {
      try {
        descriptor = ImageDescriptor.createFromURL(favicon.toURI().toURL());
        FAVICO_CACHE.put(bookmark.getId(), descriptor);
        return descriptor;
      } catch (MalformedURLException e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
View Full Code Here


    /* 2.) Check if ImageDescriptor exists in File System */
    File favicon = getImageFile(bookmark.getId());
    if (favicon.exists()) {
      try {
        descriptor = ImageDescriptor.createFromURL(favicon.toURI().toURL());
        FAVICO_CACHE.put(bookmark.getId(), descriptor);
        return descriptor;
      } catch (MalformedURLException e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
View Full Code Here

      try {
        File file = new File(feedDirectory, i + ".xml");
        if (!file.exists())
          continue;

        URI feedLink = file.toURI();

        IFeed feed = new Feed(feedLink);

        feed = DynamicDAO.save(feed);
View Full Code Here

{

  public void testMediaLocator() throws MalformedURLException
  {
    File f = new File("test.txt");
    System.out.println(f.toURI());
    System.out.println(f.toURI().toURL());
    MediaLocator l = new MediaLocator(f.toURI().toURL());
   
  }
}
View Full Code Here

  public void testMediaLocator() throws MalformedURLException
  {
    File f = new File("test.txt");
    System.out.println(f.toURI());
    System.out.println(f.toURI().toURL());
    MediaLocator l = new MediaLocator(f.toURI().toURL());
   
  }
}
View Full Code Here

  public void testMediaLocator() throws MalformedURLException
  {
    File f = new File("test.txt");
    System.out.println(f.toURI());
    System.out.println(f.toURI().toURL());
    MediaLocator l = new MediaLocator(f.toURI().toURL());
   
  }
}
View Full Code Here

    private static URL getResource(final String path) {
        if (path != null && path.length() != 0) {
            try {
                File file = new File(path);
                if (file.exists() && file.isFile()) {
                    return file.toURI().toURL();
                }
                return Thread.currentThread().getContextClassLoader().getResource(path);
            } catch (MalformedURLException ex) {
                getLog().error("Invalid resource path.", ex);
            }
View Full Code Here

   {
      // Fixup the uri and get a root context with spaces
      String deployDir = System.getProperty("jbosstest.deploy.dir");
      File file = new File(deployDir);
      file = new File(file, "dir with spaces");
      URI contextName = file.toURI();
      VirtualFile contextFile = VFS.getChild(contextName);
     
      // Create the deployment
      VirtualFile vf = contextFile.getChild("spaces.ear");
      assertNotNull(vf);
View Full Code Here

         if (!homeDirFile.exists())
         {
            throw new IllegalArgumentException("Specified " + JBossASServerConfig.PROP_KEY_JBOSSAS_HOME_DIR
                  + " does not point to a valid location: " + homeDirFile.toString());
         }
         jbossHome = homeDirFile.toURI().toURL();
      }
      // Nothing specified, so autoset relative to our location
      else
      {
         String path = Main.class.getProtectionDomain().getCodeSource().getLocation().getFile();
View Full Code Here

          * spaces we don't come crashing down.
         */
         path = URLDecoder.decode(path, "UTF-8");
         File runJar = new File(path);
         File homeFile = runJar.getParentFile().getParentFile();
         URL homeUrlFromDir = homeFile.toURI().toURL();
         jbossHome = homeUrlFromDir;
      }

      // Get Library URL
      String libUrlFromProp = props.get(JBossASServerConfig.PROP_KEY_JBOSSAS_BOOT_LIBRARY_URL);
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.