Package java.io

Examples of java.io.File.deleteOnExit()


    if (file == null && (memory.getCount() + len > fileThreshold)) {
      File temp = File.createTempFile("FileBackedOutputStream", null);
      if (resetOnFinalize) {
        // Finalizers are not guaranteed to be called on system shutdown;
        // this is insurance.
        temp.deleteOnExit();
      }
      FileOutputStream transfer = new FileOutputStream(temp);
      transfer.write(memory.getBuffer(), 0, memory.getCount());
      transfer.flush();
View Full Code Here


    String filename = makeFilename(o);
    File file = new File(directory, filename);
   
    if (file.createNewFile()) {
      if (JRProperties.getBooleanProperty(PROPERTY_TEMP_FILES_SET_DELETE_ON_EXIT)) {
        file.deleteOnExit();
      }

      FileOutputStream fos = null;
      try {
        fos = new FileOutputStream(file);
View Full Code Here

      // JOptionPane.showMessageDialog(null, "Making URL:
      // "+url.toString());
      return handleDropTransfer(url, dropRow);
    }
    File tmpfile = java.io.File.createTempFile("jabrefimport", "");
    tmpfile.deleteOnExit();
    FileWriter fw = new FileWriter(tmpfile);
    fw.write(dropStr);
    fw.close();

    // System.out.println("importing from " + tmpfile.getAbsolutePath());
View Full Code Here

    }
  }

  protected boolean handleDropTransfer(URL dropLink, int dropRow) throws IOException {
    File tmpfile = java.io.File.createTempFile("jabrefimport", "");
    tmpfile.deleteOnExit();

    // System.out.println("Import url: " + dropLink.toString());
    // System.out.println("Temp file: "+tmpfile.getAbsolutePath());

    new URLDownload(entryTable, dropLink, tmpfile).download();
View Full Code Here

               if (log.isTraceEnabled())
               {
                  log.trace("Creating file " + file);
               }
               file.createNewFile();
               file.deleteOnExit();
              
               writer = new PrintWriter(file);
               writer.println(bootstrapUrl);
               writer.flush();
            }
View Full Code Here

        String res = url.toString();
        URLDownload udl = null;

        // First of all, start the download itself in the background to a temporary file:
        final File tmp = File.createTempFile("jabref_download", "tmp");
        tmp.deleteOnExit();
        //long time = System.currentTimeMillis();
        try {
            udl = new URLDownload(frame, url, tmp);
            // TODO: what if this takes long time?
            // TODO: stop editor dialog if this results in an error:
View Full Code Here

   private String getPassivationDir(long testCount, int cacheCount)
   {
      File dir = new File(tempDir);
      dir = new File(dir, String.valueOf(testCount));
      dir.mkdirs();
      dir.deleteOnExit();
      dir = new File(dir, String.valueOf(cacheCount));
      dir.mkdirs();
      dir.deleteOnExit();
      return dir.getAbsolutePath();
   }
View Full Code Here

      dir = new File(dir, String.valueOf(testCount));
      dir.mkdirs();
      dir.deleteOnExit();
      dir = new File(dir, String.valueOf(cacheCount));
      dir.mkdirs();
      dir.deleteOnExit();
      return dir.getAbsolutePath();
   }
}
View Full Code Here

      jgSupport.setUpProperties();
     
      File tmpDir = new File(System.getProperty("java.io.tmpdir"));
      File root = new File(tmpDir, getClass().getSimpleName());
      root.mkdirs();
      root.deleteOnExit();
      tempDir = root.getAbsolutePath();
   }

   @Override
   protected void tearDown() throws Exception
View Full Code Here

            //
            VirtualFile file = VFS.getChild(url);
            if (file == null || file.exists() == false) {
               // copy to temp location and deploy from there.
               final File temp = File.createTempFile("tmp", getShortName(url.getPath()), getTempDir());
               temp.deleteOnExit();
               copy(url, temp);
               file = VFS.getChild(temp.toURI());
               deploymentName = url.toExternalForm();
            } else {
               deploymentName = file.asFileURI().toString();              
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.