Package java.io

Examples of java.io.File.toURI()


         final File bootLibFile = new File(bootLibDir, filename);
         if (!bootLibFile.exists())
         {
            System.out.println("WARNING: Could not find expected boot lib " + bootLibFile);
         }
         final URL bootLibUrl = bootLibFile.toURI().toURL();
         urls.add(bootLibUrl);
      }

      // Make a ClassLoader to be used in loading the server
      final URL[] urlArray = urls.toArray(new URL[]
View Full Code Here


   {
      super.setUp();
     
      File tmp = new File(System.getProperty("java.io.tmpdir"));
      File dir = new File(tmp, getClass().getSimpleName());
      tempDir = dir.toURI();
      dir.mkdirs();
      dir.deleteOnExit();
     
      count++;
   }
View Full Code Here

     * Stumbled over this while investigating
     *
     * https://sourceforge.net/tracker/index.php?func=detail&aid=1469903&group_id=92314&atid=600306
     */
    if (f != null) {
      return f.toURI().toString();
    } else {
      return field;
    }
  }
}
View Full Code Here

      // Create a temp file
      File dsXml = File.createTempFile(getClass().getSimpleName(), FILE_SUFFIX);
      // Write template
      writeTemplate(dsXml, values);
      // Return virtual file
      return VFS.getChild(dsXml.toURI());
   }

   public DeploymentTemplateInfo getInfo()
   {
      return info;
View Full Code Here

   */
  public static List<String> getPathnames(String directory) {
    List<String> result = new ArrayList<String>();
    File file = new File(directory);
    if (file.isFile()) {
      result.add(file.toURI().toString());
    }
    if (file.isDirectory()) {
      for (File child : file.listFiles()) {
        result.addAll(getPathnames(child.getPath()));
      }
View Full Code Here

               }
            }           
         }

         // Get the vfs uri and add the VFS uri to the cached VFS uris
         VirtualFile contentVF = VFS.getChild(contentFile.toURI());
         try
         {
            // Add the new virtual file to the cache
            repositoryName = addVirtualFileCache(contentVF);
           
View Full Code Here

    * @throws IOException
    */
   VirtualFile backup(String profileName, String name, VirtualFile original) throws IOException
   {
      File realFile = original.getPhysicalFile();
      String hash = Integer.toHexString(realFile.toURI().hashCode());
      VirtualFile backup = originals.getChild(profileName).getChild(hash + realFile.getName());
      Closeable closeable = VFS.mountReal(realFile, backup);
      mounts.put(name, closeable);
      return backup;
   }
View Full Code Here

  @Test
  public void testStaticMap() throws Exception {
    Resty r = new Resty();
    File f = r.bytes("http://maps.google.com/maps/api/staticmap?size=512x512&maptype=hybrid" +
        "&markers=size:mid%7Ccolor:red%7C37.815649,-122.477646&sensor=false").save(File.createTempFile("google", ".png"));
    System.out.println(f.toURI());
    f.delete();
  }
}
View Full Code Here

                    URLDownload udl = new URLDownload(editor, url,
                            file);
                    frame.output(Globals.lang("Downloading..."));
                    udl.download();
                    frame.output(Globals.lang("Download completed"));
                    feditor.setText(file.toURI().toURL().toString());
                    editor.updateField(feditor);

                }catch (IOException ioex){
                    logger.log(Level.SEVERE, "Error while downloading file",
                            ioex);
View Full Code Here

                                .lang("Drag and Drop Error"),
                                JOptionPane.ERROR_MESSAGE);
                return;
            }
            File fl = filelist.get(0);
            feditor.setText(fl.toURI().toURL().toString());
            editor.updateField(feditor);

        }catch (UnsupportedFlavorException nfe){
            JOptionPane.showMessageDialog(editor, Globals
                    .lang("Operation not supported"), Globals
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.