Public interface ITPDSDataReceiver
The ITPDSDataReceiver interface provides for receiving binary data from the ITP/Server server. This is typically the result document of an ITP process.
This interface is used to receive data send by the SendFile command's Src(…) Dest(…).
import com.aia_itp.itpdsapi.*;
import java.io.*;
class MyClass implements ITPDSDataReceiver
{
....
public OutputStream ITPDSReceiveData(String DataItem)
{
try
{
return new BufferedOutputStream(new FileOutputStream("/temp/myfile.pdf"));
}
catch(Exception e)
{
return null;
}
}
public void ITPDSReceiveDataFinished(String DataItem, OutputStream out)
{
try
{
out.close();
}
catch(Exception e)
{
}
}
....
}
public java.io.OutputStream ITPDSReceiveData(java.lang.String DataItem)
Method called when the ITP/Server server executes a SendFile command. This method should return either null to indicate that it does not want to receive the data or an OutputStream object to which the data will be written.
public void ITPDSReceiveDataFinished(java.lang.String DataItem, java.io.OutputStream out)
Method called when receipt of the data has been finished. When this method is called all data has been written to the OutputStream returned by ITPDSReceiveData. It is typically used to close the OutputStream object.