Package java.io

Examples of java.io.File.deleteOnExit()


      JAXBRepositoryContentMetadataPersister testee = new JAXBRepositoryContentMetadataPersister(temp.toURI());
      testee.store("test", rcm);
     
      // Ensure we clean up
      File stored = testee.getMetadataPath("test");
      stored.deleteOnExit();
      toDelete.add(stored);
     
      InputStreamReader isr = new InputStreamReader(new FileInputStream(stored));
      StringWriter writer = new StringWriter();
      int read;
View Full Code Here


        if (!tempFolder.exists())
            tempFolder.mkdirs();
        assertTrue(tempFolder.isDirectory());

        File result = File.createTempFile(prefix, suffix, tempFolder);
        result.deleteOnExit();
        return result;
    }

    public void compareByteArrays(byte a[], byte b[]) {
        assertTrue(a.length == b.length);
View Full Code Here

   public static Test suite() throws Exception
   {
      File tmpDir = new File(System.getProperty("java.io.tmpdir"));
      File root = new File(tmpDir, ClusteredSessionMemoryLeakTestCase.class.getSimpleName());
      root.mkdirs();
      root.deleteOnExit();
      return CacheConfigTestSetup.getTestSetup(ClusteredSessionMemoryLeakTestCase.class, cacheContainers, false, root.getAbsolutePath(), true);
   }

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

         if (war.exists())
         {
            File huge = new File(war, "huge.bin");
            if (huge.exists() && !huge.delete())
            {
               huge.deleteOnExit();
            }
         }
      }     
   }
View Full Code Here

   public static String getPassivationDir(String rootDir, long testCount, int cacheCount)
   {
      File dir = new File(rootDir);
      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();
   }
  
   public static void cleanFilesystem(String path)
   {
View Full Code Here

    } catch (IOException ex) {
      // In case creating default temporary folder failed, use default temporary files folder
      temporaryFolder = null;
    }
    File temporaryFile = File.createTempFile(prefix, suffix, temporaryFolder);
    temporaryFile.deleteOnExit();
    return temporaryFile;
  }

  /**
   * Deletes all the temporary files created with {@link #createTemporaryFile(String, String) createTemporaryFile}.
View Full Code Here

       
        // Create temporary folder 
        if (!sessionTemporaryFolder.mkdirs()) {
          throw new IOException("Can't create temporary folder " + sessionTemporaryFolder);
        } else {
          sessionTemporaryFolder.deleteOnExit();
        }
       
        // Launch a timer that updates modification date of the temporary folder each minute
        final long updateDelay = 60000;
        new Timer(true).schedule(new TimerTask() {
View Full Code Here

   * Returns the file name of a temporary copy of <code>input</code> content.
   */
  private String copyInputStreamToTmpFile(InputStream input,
                                          String suffix) throws IOException {
    File tmpFile = File.createTempFile("extension", suffix);
    tmpFile.deleteOnExit();
    copyInputStreamToFile(input, tmpFile);
    return tmpFile.toString();
  }

  /**
 
View Full Code Here

    @Test
    public void testLargeData() throws Exception {

      final File file = QAUtil.createTestfile_4000k();
    file.deleteOnExit();
     
      IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
     
      public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
       
View Full Code Here

TOP
Copyright © 2015 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.