{
return CourierUtil.messageFromLocalFile(work);
}
catch (final FileNotFoundException ex)
{
throw new CourierTransportException(ex);
}
catch (final IOException ex)
{
throw new CourierMarshalUnmarshalException(ex);
}
catch (final CourierException ex)
{
throw ex;
}
catch (final Exception ex)
{
throw new CourierException(ex);
}
}
File tmpFile = null;
try
{
Method download = handler.getClass().getMethod("downloadFile",
new Class[]
{ File.class });
tmpFile = (File) download.invoke(handler, new Object[]
{ work });
return CourierUtil.messageFromLocalFile(tmpFile);
}
catch (FileNotFoundException ex)
{
throw new CourierTransportException(ex);
}
catch (IOException ex)
{
throw new CourierTransportException(ex);
}
catch (final CourierException ex)
{
throw ex;
}
catch (Exception e)
{
throw new CourierTransportException(e);
}
finally
{
if ((null != tmpFile) && !tmpFile.delete() && _logger.isDebugEnabled())
{