Examples of IOException


Examples of java.io.IOException

  public void commit() throws IOException {
    try {
      conn.commit();
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
      e.printStackTrace();
      // throw e;
    }
  }
View Full Code Here

Examples of java.io.IOException

  public void close() throws IOException {
    try {
      conn.close();
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      throw new IOException(sqle.getMessage());
    } catch (Exception e) {
      e.printStackTrace();
      // throw e;
    }
View Full Code Here

Examples of java.io.IOException

          insertStmt = conn.prepareStatement("INSERT INTO JoramDB VALUES (?, ?)");
          updateStmt = conn.prepareStatement("UPDATE JoramDB SET content=? WHERE name=?");
          deleteStmt = conn.prepareStatement("DELETE FROM JoramDB WHERE name=?");
      } catch (Exception sqle) {
          sqle.printStackTrace();
          throw new IOException(sqle.getMessage());
      }
      logger.log(BasicLevel.WARN, "Database reconnection success");
  }
View Full Code Here

Examples of java.io.IOException

    public void readExternal(ObjectInput in) throws IOException,
    ClassNotFoundException {
        try {
            parse(in.readUTF());
        } catch(MimeTypeParseException e) {
            throw new IOException(e.toString());
        }
    }
View Full Code Here

Examples of java.io.IOException

          writeElement(MappingNodeConstants.Tags.FORMATTED_DOCUMENT, Boolean.toString(doc.isFormatted()));
          loadNode(doc.getRootNode());
          writer.writeEndElement();
          writer.writeEndDocument();
    } catch (XMLStreamException e) {
      throw new IOException(e);
    }
    }
View Full Code Here

Examples of java.io.IOException

        File tmpDir = File.createTempFile(prefix, suffix, parentDirectory); // create file with unique name
        boolean deleteOk = tmpDir.delete(); // delete the tmp file and...
        boolean mkdirsOk = tmpDir.mkdirs(); // ...convert it to a directory

        if (!deleteOk || !mkdirsOk) {
            throw new IOException("Failed to create temp directory named [" + tmpDir + "]");
        }

        return tmpDir;
    }
View Full Code Here

Examples of java.io.IOException

import java.io.IOException;

public class _IOException {
  public static IOException createNewInstance(Throwable t){
    IOException io = new IOException();
    io.initCause(t);
    return io;
  }
View Full Code Here

Examples of java.io.IOException

        break;
      }
    }
    VirtualFile file =this.files.get(path);
    if (file == null) {
      throw new IOException(RuntimePlugin.Util.getString("udf_model_not_found", name)); //$NON-NLS-1$
    }
    List<FunctionMethod> udfMethods = FunctionMetadataReader.loadFunctionMethods(file.openStream());
    ActivityReport<ReportItem> report = new ActivityReport<ReportItem>("UDF load"); //$NON-NLS-1$
    FunctionMetadataValidator.validateFunctionMethods(udfMethods,report);
    if(report.hasItems()) {
View Full Code Here

Examples of java.io.IOException

                        {
                            result.addMapping( inputCode, ((LiteralName)nextToken).name );
                        }
                        else
                        {
                            throw new IOException( "Error parsing CMap beginbfchar, expected{COSString " +
                                                   "or COSName} and not " + nextToken );
                        }
                    }
                }
               else if( op.op.equals( BEGIN_BASE_FONT_RANGE ) )
View Full Code Here

Examples of java.io.IOException

                {
                    retval = MARK_END_OF_DICTIONARY;
                }
                else
                {
                    throw new IOException( "Error: expected the end of a dictionary.");
                }
                break;
            }
            case ']':
            {
                retval = MARK_END_OF_ARRAY;
                break;
            }
            case '[':
            {
                List list = new ArrayList();
               
                Object nextToken = parseNextToken( is );
                while( nextToken != MARK_END_OF_ARRAY )
                {
                    list.add( nextToken );
                    nextToken = parseNextToken( is );
                }
                retval = list;
                break;
            }
            case '<':
            {
                int theNextByte = is.read();
                if( theNextByte == '<' )
                {
                    Map result = new HashMap();
                    //we are reading a dictionary
                    Object key = parseNextToken( is );
                    while( key instanceof LiteralName && key != MARK_END_OF_DICTIONARY )
                    {
                        Object value = parseNextToken( is );
                        result.put( ((LiteralName)key).name, value );
                        key = parseNextToken( is );
                    }
                    retval = result;
                }
                else
                {
                    //won't read more than 512 bytes
                   
                    int multiplyer = 16;
                    int bufferIndex = -1;
                    while( theNextByte != -1 && theNextByte != '>' )
                    {
                        int intValue = 0;
                        if( theNextByte >= '0' && theNextByte <= '9' )
                        {
                            intValue = theNextByte - '0';
                        }
                        else if( theNextByte >= 'A' && theNextByte <= 'F' )
                        {
                            intValue = 10 + theNextByte - 'A';
                        }
                        else if( theNextByte >= 'a' && theNextByte <= 'f' )
                        {
                            intValue = 10 + theNextByte - 'a';
                        }
                        else
                        {
                            throw new IOException( "Error: expected hex character and not " +
                                (char)theNextByte + ":" + theNextByte );
                        }
                        intValue *= multiplyer;
                        if( multiplyer == 16 )
                        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.