Examples of toURL()


Examples of java.io.File.toURL()

  }
 
 
  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

Examples of java.io.File.toURL()

      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

Examples of java.io.File.toURL()

    }

    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

Examples of java.io.File.toURL()

            FileOutputStream fs = new FileOutputStream(tmpFile);
            PrintWriter out = new PrintWriter((OutputStream) fs);
            out.println(text);
            out.close(); // close the streams

            String urlString = tmpFile.toURL().toString();
            Debug.output("WebBrowser: created " + urlString);
            return urlString;

        } catch (SecurityException se) {
            Debug.error("WebBrowser.writeAndGenerateURL: " + se);
View Full Code Here

Examples of java.io.File.toURL()

                        String s = shp.getCanonicalPath();
                        int pos1 = s.lastIndexOf('.');
                        String name = s.substring(0, pos1);
                        File shx = new File(s.substring(0, pos1) + ".shx");
                        File dbf = new File(s.substring(0, pos1) + ".dbf");
                        EsriLayer layer = new EsriLayer(name, dbf.toURL(), shp.toURL(), shx.toURL());
                        _layerHandler.addLayer(layer);
                    } catch (Exception exception) {
                        System.out.println(exception);
                    }
                }
View Full Code Here

Examples of java.io.File.toURL()

        file = edm.getPrimaryFile().getFile(true);
      } else {
        file = new File(dmContent.getDownloadState().getPrimaryFile());
      }
      try {
        contentPath = file.toURL().toString();
      } catch (MalformedURLException e) {
        contentPath = file.getAbsolutePath();
      }
    } else {
      //use the stream path if download is not complete.
View Full Code Here

Examples of java.io.File.toURL()

                ex.printStackTrace();
            }
        }
        File wsdl = new File(wsdlPath);
        try {
            ss = new BasicService(wsdl.toURL(), SERVICE_NAME);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        port = ss.getSoapHttpPort();
        if (usePipe) {
View Full Code Here

Examples of java.io.File.toURL()

            url = new URL(path);
        } catch (MalformedURLException mfex) {
            try {
                File f = new File(path);
                if (f.exists() && !f.isDirectory()) {
                    url = f.toURL();
                }
            } catch (Exception fnex) {
                // ignorable
            }
        } catch (Exception ex) {
View Full Code Here

Examples of java.io.File.toURL()

        }
        try {
            url = URLFactory.createURL(path);
        } catch (MalformedURLException mfex) {
            File f = new File(path);
            url = f.toURL();
        }

        return url;
    }
View Full Code Here

Examples of java.io.File.toURL()

        URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader();
        Method method;
        try {
          method = URLClassLoader.class.getDeclaredMethod("addURL",new Class[]{URL.class});
          method.setAccessible(true);
          method.invoke(sysloader,new Object[]{ jsynJar.toURL() });

          // So, jsynoptic jar should be added in the class path now
          method = Class.forName("jsynoptic.ui.Run").getDeclaredMethod("main",new Class[]{String[].class});
          // invoke the main function
          method.invoke(null,new Object[]{new String[]{}});
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.