Examples of trackTempFile()


Examples of org.pentaho.platform.api.util.ITempFileDeleter.trackTempFile()

    ITempFileDeleter fileDeleter = null;
    if ( ( session != null ) ) {
      fileDeleter = (ITempFileDeleter) session.getAttribute( ITempFileDeleter.DELETER_SESSION_VARIABLE );
      if ( fileDeleter != null ) {
        fileDeleter.trackTempFile( file ); // make sure the deleter knows to clean this puppy up...
      }
    }

    if ( ( getUploadedFileItem().getName().toLowerCase().endsWith( ".zip" ) || getUploadedFileItem().getContentType()
        .equals( "application/zip" ) ) ) { //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of org.pentaho.platform.api.util.ITempFileDeleter.trackTempFile()

    ITempFileDeleter fileDeleter;
    if ( ( session != null ) ) {
      fileDeleter = (ITempFileDeleter) session.getAttribute( ITempFileDeleter.DELETER_SESSION_VARIABLE );
      if ( fileDeleter != null ) {
        fileDeleter.trackTempFile( tarFile ); // make sure the deleter knows to clean this puppy up...
      }
    }

    return handleTar( tarFile );
  }
View Full Code Here

Examples of org.pentaho.platform.api.util.ITempFileDeleter.trackTempFile()

    if ( parentDir != null ) {
      parentDir.mkdirs();
    }
    final File file = File.createTempFile( newPrefix, extn, parentDir );
    if ( fileDeleter != null ) {
      fileDeleter.trackTempFile( file );
    } else {
      // There is no deleter, so cleanup on VM exit. (old behavior)
      file.deleteOnExit();
    }
    return file;
View Full Code Here

Examples of org.pentaho.platform.api.util.ITempFileDeleter.trackTempFile()

    }
    final String newPrefix =
        new StringBuilder().append( prefix ).append( session.getId().substring( 0, 10 ) ).append( '-' ).toString();
    final File file = File.createTempFile( newPrefix, extn, parentDir );
    if ( fileDeleter != null ) {
      fileDeleter.trackTempFile( file );
    } else {
      // There is no deleter, so cleanup on VM exit. (old behavior)
      file.deleteOnExit();
    }
    return file;
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.StandaloneTempFileDeleter.trackTempFile()

    deleter.doTempFileCleanup();
    assertTrue( file1.exists() ); // This file will be left over
    assertFalse( file2.exists() ); // The deleter should have removed this
    assertFalse( deleter.hasTempFile( file2.getName() ) ); // After doTempFileCleanup() the list should be empty
    // The tearDown should blow away everything else...
    deleter.trackTempFile( file2 ); // Add known deleted file to the deleter
    deleter.doTempFileCleanup(); // Validates cleanup doesn't choke on missing files
    // Test that IllegalArgumentException if passed a null
    try {
      deleter.trackTempFile( null );
      fail();
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.StandaloneTempFileDeleter.trackTempFile()

    // The tearDown should blow away everything else...
    deleter.trackTempFile( file2 ); // Add known deleted file to the deleter
    deleter.doTempFileCleanup(); // Validates cleanup doesn't choke on missing files
    // Test that IllegalArgumentException if passed a null
    try {
      deleter.trackTempFile( null );
      fail();
    } catch ( IllegalArgumentException expected ) {
      //ignored
    }
  }
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.