Package org.teiid.translator

Examples of org.teiid.translator.TranslatorException


        @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() {
View Full Code Here

TOP

Related Classes of org.teiid.translator.TranslatorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.