org.jboss.virtual.spi
Interface TempStore

All Known Implementing Classes:
DeleteOnExitTempStore, MkdirTempStore, TrackingTempStore

public interface TempStore

The temp store

Author:
ales.justin@jboss.org

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.
 

Method Detail

createTempFolder

java.io.File createTempFolder(VirtualFile file)
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.

Parameters:
file - the file to copy
Returns:
new temp folder or null if we fall back to default temp dir

createTempFolder

java.io.File createTempFolder(java.lang.String outerName,
                              java.lang.String innerName)
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.

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

void clear()
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).