Package java.io

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


                        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

        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

                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

            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

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

        return url;
    }
View Full Code Here

        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

         else {
            // Use given path
            File f = new File(this.directoryName, this.scriptFileName);
            if (f.exists() && f.isFile() && f.canRead()) {
               try {
                  this.scriptFileUrl = f.toURL();
               } catch (MalformedURLException e) {
                  log.warning(e.toString());
               }
            }
         }
View Full Code Here

                        }
                        if (candidate.exists())
                        {
                            try
                            {
                                moduleUrl = candidate.toURL().toExternalForm();
                            }
                            catch (final MalformedURLException exception)
                            {
                                // ignore
                            }
View Full Code Here

            System.exit(1);
        }
       
        try {
            File wsdl = new File(args[0]);
            SOAPService service = new SOAPService(wsdl.toURL(), SERVICE_NAME);
            Greeter port = service.getSoapPort();

            implicitPropagation(port);

            explicitPropagation(port);
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.