FileDocCategorySizeDatePackage
DeleteFileOnCloseInputStream.javaAPI DocAzureus 3.0.3.41846Wed Apr 25 10:37:12 BST 2007com.aelitis.azureus.core.util

DeleteFileOnCloseInputStream

public class DeleteFileOnCloseInputStream extends FilterInputStream

Fields Summary
private InputStream
in
private File
file
private boolean
closed
Constructors Summary
public DeleteFileOnCloseInputStream(File file)

		this( new FileInputStream( file ), file );
	
protected DeleteFileOnCloseInputStream(InputStream _in, File _file)

		super( _in );
				
		in		= _in;
		file	= _file;
	
Methods Summary
public voidclose()

		if ( closed ){
			
			return;
		}
		
		closed = true;
		
		try{
			in.close();
		
		}finally{
			
			if ( !file.delete()){
				
				Debug.out( "Failed to delete file '" + file + "'" );
			}
		}