org.jboss.virtual.plugins.copy
Class TrackingTempStore

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

public class TrackingTempStore
extends java.lang.Object
implements TempStore

Track files temp store.

Author:
Ales Justin

Constructor Summary
TrackingTempStore(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.
 java.util.Set<java.io.File> getFiles()
          Get files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackingTempStore

public TrackingTempStore(TempStore delegate)
Method Detail

getFiles

public java.util.Set<java.io.File> getFiles()
Get files.

Returns:
the files

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