Package java.io

Examples of java.io.File.toURL()


  protected void execute(Store store, UpdateAssertCommandArguments arguments) {
    File uploadFile = arguments.getUploadFile();
    Model model = ModelFactory.createDefaultModel();
    String fileURLString;
    try {
      fileURLString = uploadFile.toURL().toString();
    } catch (MalformedURLException e1) {
      throw new RuntimeException(e1);
    }
    String lang = "RDF/XML";
    if (fileURLString.endsWith(".nt")) {
View Full Code Here


     */
    public ComponentClassLoader(File componentDir) throws MalformedURLException, SecurityException {
        final List list = new ArrayList();
        File classesDir = new File(componentDir, "classes");
        if (classesDir.exists()) {
            list.add(classesDir.toURL());
        }
        File libDir = new File(componentDir, "lib");
        File[] jars = libDir.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".jar") || name.endsWith(".zip");
View Full Code Here

      return in;
    }
    final File f = new File(name);
    if (f.canRead())
    {
      return f.toURL();
    }
    return null;
  }

  /**
 
View Full Code Here

    final File out = new File(outFile);
    final OutputStream base = new FileOutputStream(out);
    final Writer w = new BufferedWriter(new OutputStreamWriter(base, encoding));
    try
    {
      convertReport(reportURL, out.toURL(), w, encoding);
    }
    finally
    {
      w.close();
    }
View Full Code Here

    final File localFile = new File("jlfgr-1_0.jar");
    if (localFile.exists() && localFile.canRead() && localFile.isFile())
    {
      try
      {
        return localFile.toURL();
      }
      catch (MalformedURLException e)
      {
        logger.warn("Unable to form local file URL. Is there no local filesystem?");
      }
View Full Code Here

    {
      if (classpathFile.exists() && classpathFile.canRead() && classpathFile.isFile())
      {
        try
        {
          return classpathFile.toURL();
        }
        catch (MalformedURLException e)
        {
          logger.warn("Unable to form local file URL. Is there no local filesystem?");
        }
View Full Code Here

      if (o instanceof File)
      {
        final File f = (File) o;
        if (f.canRead())
        {
          return f.toURL();
        }
      }
      else if (o instanceof String)
      {
        if (getBaseURL() == null)
View Full Code Here

  }
 
 
  public Version determineWGAVersion() throws IOException, ClassNotFoundException, IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    File classesDir = new File(getDeployDir(), "WEB-INF/classes");
    URLClassLoader loader = new URLClassLoader(new URL[] {classesDir.toURL()}, this.getClass().getClassLoader());
    Class wgaVersionClass = loader.loadClass("de.innovationgate.wgpublisher.WGAVersion");
    Version version = new Version();
    version.setMajorVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MAJOR_VERSION").getInt(null));
    version.setMinorVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MINOR_VERSION").getInt(null));
    version.setMaintenanceVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MAINTENANCE_VERSION").getInt(null));
View Full Code Here

      return false;
    }
    try {
      File wgutils = new File(getWebappDir(), "libs/wgutils.jar");
      URL[] jars = new URL[1];
      jars[0] = wgutils.toURL();
      URLClassLoader classLoader = new URLClassLoader(jars);
      Class factoryClass = classLoader.loadClass("de.innovationgate.wga.config.WGAConfigurationFactory");
    } catch (MalformedURLException e) {
      return false;
    } catch (ClassNotFoundException e) {
View Full Code Here

    }

    public SVGRasterizer(String filename) {
        File f = new File(filename);
        try {
            this.input = new TranscoderInput(f.toURL().toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
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.