public class TempFileDataSource
extends javax.activation.FileDataSource
DataSource
for use by OpenContent.
The getContent() uses temporary files as a staging point between
grabbing them from Documentum and sending them to the user, and this
data source will perform cleanup on the temporary files it is given.
It accomplishes this by overriding the finalize()
method
and calling File.delete()
on the passed in file object.Constructor and Description |
---|
TempFileDataSource(java.io.File f)
Initialize a new
FileDataSource with one small difference-
the file passed in will be deleted when this object is garbage
collected. |
TempFileDataSource(java.lang.String filename)
Initialize a new
FileDataSource with one small difference-
the file passed in will be deleted when this object is garbage
collected. |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Override the default finalize by calling delete on the file passed
in as a constructor argument.
|
public TempFileDataSource(java.io.File f)
FileDataSource
with one small difference-
the file passed in will be deleted when this object is garbage
collected.f
- the filepublic TempFileDataSource(java.lang.String filename)
FileDataSource
with one small difference-
the file passed in will be deleted when this object is garbage
collected.filename
- the system-dependent file name