Examples of toURI()


Examples of java.io.File.toURI()

      objFile = "model.obj";
    }

    File tempZipFile = File.createTempFile("urlContent", "tmp");
    OBJWriter.writeNodeInZIPFile(model, tempZipFile, 0, objFile, "3D model " + objFile);
    return new TemporaryURLContent(new URL("jar:" + tempZipFile.toURI().toURL() + "!/"
        + URLEncoder.encode(objFile, "UTF-8").replace("+", "%20")));
  }
}
View Full Code Here

Examples of java.io.File.toURI()

                planner.addEvents(p.getEvents());
            }
            writer.write(planner.getTimeTable());
            writer.write("</body></html>");
            writer.close();
            Helper.openURL(file.toURI());
        } catch (IOException ex) {
            new RuntimeException("Problem while writing timetable of persons!", ex);
        }
    }
View Full Code Here

Examples of java.io.File.toURI()

                writer.write("<br/>");
            }

            writer.write("</body></html>");
            writer.close();
            Helper.openURL(file.toURI());
        } catch (IOException ex) {
            new RuntimeException("Problem while writing timetable of persons!", ex);
        }
    }
}
View Full Code Here

Examples of java.io.File.toURI()

    if (vdbURL.getProtocol().equals("jar")) {
      InputStream is = vdbURL.openStream();
      File temp = File.createTempFile("temp", ".vdb", new File(UnitTestUtil.getTestScratchPath()));
      temp.deleteOnExit();
      FileUtils.write(is, temp);
      vdbURL = temp.toURI().toURL();
    }
    return new IndexMetadataFactory(vdbURL);
  }

}
View Full Code Here

Examples of java.io.File.toURI()

 
 
 
  public static IContainer dirLinkFolderToContainer(IFolder folder){
    File linkedFile = WGUtils.resolveDirLink(folder.getLocation().toFile());
    IContainer[] containers = folder.getWorkspace().getRoot().findContainersForLocationURI(linkedFile.toURI());

    if (containers != null && containers.length > 0) {
      IContainer container = containers[0];
      if (container instanceof IFolder) {
        return container;
View Full Code Here

Examples of java.io.File.toURI()

    }
  }
 
  public static IContainer resolveDirLink(IFile file) {
    File linkedFile = WGUtils.resolveDirLink(file.getParent().getLocation().toFile());
    return  (IContainer) file.getWorkspace().getRoot().findContainersForLocationURI(linkedFile.toURI())[0];
  }
 
  public static IContainer resolveDirLink(IContainer container) {
    return resolveDirLink(container.getFile(new Path(WGUtils.DIRLINK_FILE)));
  }
View Full Code Here

Examples of java.io.File.toURI()

      Locale defaultLocale = Locale.getDefault();
      Locale.setDefault(DEFAULT_LOCALE);
      File furnitureLibraryFile = File.createTempFile("furniture", ".sh3f");
      furnitureLibraryFile.deleteOnExit();
      copyFile(new File(furnitureLibraryName), furnitureLibraryFile);     
      URL furnitureLibraryUrl = furnitureLibraryFile.toURI().toURL();
      String furnitureResourcesLocalDirectory = preferences.getFurnitureResourcesLocalDirectory();
      URL furnitureResourcesUrlBase = furnitureResourcesLocalDirectory != null
          ? new File(furnitureResourcesLocalDirectory).toURI().toURL()
          : null;
      final List<CatalogPieceOfFurniture> furniture = new ArrayList<CatalogPieceOfFurniture>();
View Full Code Here

Examples of java.io.File.toURI()

                                                        File.pathSeparator);
        while (tokenizer.hasMoreTokens()) {
            String path = tokenizer.nextToken();
            try {
                File libFile = new File(path);
                urls.add(libFile.toURI().toURL());
            } catch (IOException ioe) {
                // Failing a toCanonicalPath on a file that
                // exists() should be a JVM regression test,
                // therefore we have permission to freak uot
                throw new RuntimeException(ioe.toString());
View Full Code Here

Examples of java.io.File.toURI()

        IContainer container = (IContainer) selectedElement;

        IFile dirlink = container.getFile(new Path("dirlink.xml"));
        if (dirlink.exists()) {
          File linkedFile = WGUtils.resolveDirLink(container.getLocation().toFile());
          container = (IContainer) container.getWorkspace().getRoot().findContainersForLocationURI(linkedFile.toURI())[0];

        }

        if (WGADesignStructureHelper.isDesignFolder(container)) {
          _designContainer = container;
View Full Code Here

Examples of java.io.File.toURI()

    // TODO: should throw more specific exception (PWW 25/07/2006)
    public void setDocument(File file)
            throws Exception {
        resetListeners();
        File parent = file.getAbsoluteFile().getParentFile();
        String parentURL = ( parent == null ? "" : parent.toURI().toURL().toExternalForm());
        setDocument(
                loadDocument(file.toURI().toURL().toExternalForm()),
                parentURL
        );
    }
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.