@Override
public void execute() throws TranslatorException {
String filePath = (String)command.getArguments().get(0).getArgumentValue().getValue();
Object file = command.getArguments().get(1).getArgumentValue().getValue();
if (file == null || filePath == null) {
throw new TranslatorException(UTIL.getString("non_null")); //$NON-NLS-1$
}
InputStream is = null;
try {
if (file instanceof SQLXML) {
is = ((SQLXML)file).getBinaryStream();
} else if (file instanceof Clob) {
is = new ReaderInputStream(((Clob)file).getCharacterStream(), encoding);
} else if (file instanceof Blob) {
is = ((Blob)file).getBinaryStream();
} else {
throw new TranslatorException(UTIL.getString("unknown_type")); //$NON-NLS-1$
}
ObjectConverterUtil.write(is, fc.getFile(filePath));
} catch (IOException e) {
throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
} catch (SQLException e) {
throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
}
}
@Override
public void close() {