org.jboss.virtual.plugins.copy
Class DeleteOnExitTempStore

java.lang.Object
  extended by org.jboss.virtual.plugins.copy.DeleteOnExitTempStore
All Implemented Interfaces:
TempStore

public class DeleteOnExitTempStore
extends java.lang.Object
implements TempStore

Delete on exit temp store wrapper.

Author:
Ales Justin

Constructor Summary
DeleteOnExitTempStore(TempStore delegate)
           
 
Method Summary
 void clear()
          Clear newly created temp folders.
 java.io.File createTempFolder(java.lang.String outerName, java.lang.String innerName)
          Create temp folder for nested zip file.
 java.io.File createTempFolder(VirtualFile file)
          Create temp folder into which contents of this file will be temp copied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteOnExitTempStore

public DeleteOnExitTempStore(TempStore delegate)
Method Detail

createTempFolder

public java.io.File createTempFolder(VirtualFile file)
Description copied from interface: TempStore
Create temp folder into which contents of this file will be temp copied. This folder should be unique as the file name will remain the same. This method can return null, which means we fall back to default temp dir mechanism.

Specified by:
createTempFolder in interface TempStore
Parameters:
file - the file to copy
Returns:
new temp folder or null if we fall back to default temp dir

createTempFolder

public java.io.File createTempFolder(java.lang.String outerName,
                                     java.lang.String innerName)
Description copied from interface: TempStore
Create temp folder for nested zip file. The folder doesn't have to be unique as the nested file's name will be joined with GUID. This method can return null, which means we fall back to default temp dir mechanism.

Specified by:
createTempFolder in interface TempStore
Parameters:
outerName - outer file's name
innerName - nested file's name
Returns:
temp folder or null if we fall back to default temp dir

clear

public void clear()
Description copied from interface: TempStore
Clear newly created temp folders. This will be invoked once VFSContext is no longer used. But it's probably better to mark newly created temp dir to be deleted on JVM exit (File::deleteOnExit).

Specified by:
clear in interface TempStore