Hi All ,
I am using the following code to write to a blob to a file . When I just run the java Class it works fine .
But nothing gets written into the file when this Class is executed from the Server (I am running this as a Oracle ADF Application from the Weblogic Server 10.3.5).
I can see the file getting created but its empty. I also made sure that that file was permissions for all kind of users.
public static int execute(File blobFile, BlobDomain blob)
{
int success = 1;
try
{
FileOutputStream outStream = new FileOutputStream(blobFile);
InputStream inStream = blob.getBinaryStream();
int length = -1;
int size = blob.getBufferSize();
byte[] buffer = new byte[size];
while ((length = inStream.read(buffer)) != -1)
{
System.out.println("^^%^%^ I should write");
outStream.write(buffer, 0, length);
outStream.flush();
}
inStream.close();
outStream.close();
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("ERROR(djv_exportBlob) Unable to export:"+blobFile.getName());
success = 0;
}
finally
{
return success;
}
}