Examples of deleteOnExit()


Examples of java.io.File.deleteOnExit()

        if (file.exists()) {
            file.delete();
            file = new File(DataCrow.webDir, filename);
        }
           
        file.deleteOnExit();
        try {
            Utilities.writeToFile(icon, filename);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of java.io.File.deleteOnExit()

      elem.setAttribute("resource", "sqlMap.xml");
      sqlMapElem.item(0).appendChild(elem);
     
      Transformer trans = TransformerFactory.newInstance().newTransformer();
      File tempFile = File.createTempFile("sqlMapConfig", ".xml");
      tempFile.deleteOnExit();
      trans.transform(new DOMSource(doc),new StreamResult(tempFile));
     
      //从临时的配置文件中初始化sqlMapClient
      input = new FileInputStream(tempFile);
      SqlMapClientHolder.sqlMapClient = SqlMapClientBuilder
View Full Code Here

Examples of java.io.File.deleteOnExit()

       catch (IOException e)
       {
           logger.error( "Creating init script file temp file", e );
           return null;
       }
       file.deleteOnExit();

        if (extractResourceAsFile(resourceClass, resourceName + INIT_SCRIPT_EXTENSION, file)) {
         return file;
        }
View Full Code Here

Examples of java.io.File.deleteOnExit()

            }
        } else {
            File tmpDir = (TMP_DATA_DIR == null) ? null : new File(TMP_DATA_DIR);
            String docname = FileUtils.basename(docId);
            File tmpFile = File.createTempFile(docname, ".tmp", tmpDir);
            tmpFile.deleteOnExit();
            ILongCache<int[]> pool = new DiskPagedLongCache<int[]>(tmpFile, MemoryMappedDocumentTable.CACHED_PAGES, new IntCodec());
            mmDoctbl.setBufferPool(pool);
        }
    }
View Full Code Here

Examples of java.io.File.deleteOnExit()

    public void testBIndexMultiValueFile() throws IOException, DbException {
        File tmpDir = FileUtils.getTempDir();
        Assert.assertTrue(tmpDir.exists());
        File tmpFile = new File(tmpDir, "test1.bmidx");
        tmpFile.deleteOnExit();
        if(tmpFile.exists()) {
            Assert.assertTrue(tmpFile.delete());
        }
        System.out.println("Use index file: " + tmpFile.getAbsolutePath());
        BIndexMultiValueFile btree = new BIndexMultiValueFile(tmpFile);
View Full Code Here

Examples of java.io.File.deleteOnExit()

    public void testBIndexFile() throws IOException, DbException {
        File tmpDir = FileUtils.getTempDir();
        Assert.assertTrue(tmpDir.exists());
        File tmpFile = new File(tmpDir, "test1.bfidx");
        tmpFile.deleteOnExit();
        if(tmpFile.exists()) {
            Assert.assertTrue(tmpFile.delete());
        }
        System.out.println("Use index file: " + tmpFile.getAbsolutePath());
        BIndexFile btree = new BIndexFile(tmpFile, true);
View Full Code Here

Examples of java.io.File.deleteOnExit()

    byte[] decodedTorrent = Base64.decode(b64);

    File tempTorrentFile;
    try {
      tempTorrentFile = File.createTempFile("AZU", ".torrent");
      tempTorrentFile.deleteOnExit();
      String filename = tempTorrentFile.getAbsolutePath();
      FileUtil.writeBytesAsFile(filename, decodedTorrent);

      TOTorrent torrent = TorrentUtils.readFromFile(tempTorrentFile, false);
      // Security: Only allow torrents from whitelisted trackers
View Full Code Here

Examples of java.io.File.deleteOnExit()

    File tempFile() {
        try {
            final File tempFile = File.createTempFile("jar_extract_", "_tmp");

            tempFile.deleteOnExit();

            return tempFile;
        } catch (IOException e) {
            throw new GradleException("failed to create temp file to extract class from jar into", e);
        }
View Full Code Here

Examples of java.io.File.deleteOnExit()

                public void TorrentDownloaderEvent(int state,
                    TorrentDownloader inf) {
                  if (state == TorrentDownloader.STATE_FINISHED) {

                    File file = inf.getFile();
                    file.deleteOnExit();

                    // Do a quick check to see if it's a torrent
                    if (!TorrentUtil.isFileTorrent(file, Utils.findAnyShell(),
                        file.getName())) {
                      return;
View Full Code Here

Examples of java.io.File.deleteOnExit()

      public void azureusCoreRunning(AzureusCore core) {

        File tempTorrentFile;
        try {
          tempTorrentFile = File.createTempFile("AZU", ".torrent");
          tempTorrentFile.deleteOnExit();
          String filename = tempTorrentFile.getAbsolutePath();
          torrent.serialiseToBEncodedFile(tempTorrentFile);

          String savePath = COConfigurationManager.getStringParameter("Default save path");
          if (savePath == null || savePath.length() == 0) {
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.