Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGBackendException


            try {
                bytes = getScaledVersion();
                return bytes.length;
            }
            catch (Exception e) {
                throw new WGBackendException("Exception determining scaled file size on " + getCachingKey(), e);
            }
        }
       
        if (isZipped()) {
            retrieveZipInputStream();
View Full Code Here


        }
        catch (WGNotSupportedException e) {
            // Fail silently here. This is the case when no scaler for this type is installed
        }
        catch (Exception e) {
            throw new WGBackendException("Exception creating scaler", e);
        }
    }
View Full Code Here

          props.put("password", "");
      }
     
      return driver.connect(jdbcPath, props);
    } catch (Exception e) {
      throw new WGBackendException("Unable to create connection.", e);
    }
    }
View Full Code Here

                catch (Exception e) {
                }
            }
        }
        catch (Exception e) {
            throw new WGBackendException("Exception fetching available databases", e);
        }
       
    }
View Full Code Here

     
        List<DatabaseInformation> dbs = null;
    try {
      dbs = getAvailableJDBCDatabases((DatabaseFilter)null);
    } catch (WGAPIException e) {
      throw new WGBackendException("Cannot create database bc. of exception when testing for existence", e);
    }
   
    if (dbs != null) {
    Iterator<DatabaseInformation> it = dbs.iterator();
      while (it.hasNext()) {
        if (it.next().getOptions().get(Database.OPTION_PATH).equalsIgnoreCase(path)) {
          throw new WGBackendException("Cannot create database bc. it already exists");
        }
      }
    }
   
    Properties props = new Properties();
        props.setProperty("createDatabaseIfNotExist", "true");
        Connection con = createJDBCConnection(info, props);
       
        String ddlScript = null;
        try {
          if (ddl != null) {
                Reader read = new InputStreamReader(ddl);
                StringWriter write = new StringWriter();
                WGUtils.inToOut(read, write, 2048);
                read.close();
                ddlScript = write.toString();
            }
        }
        catch (IOException e) {
            throw new WGBackendException("Cannot create database bc. of exception when reading initialisation script: " + e.getClass().getName() + " - " + e.getMessage());
        }
       
        try {
          if (ddlScript != null) {
                // Execute script
            con.setAutoCommit(false);
            Iterator statements = WGUtils.deserializeCollection(ddlScript, ";", false, new Character('\'')).iterator();
              Statement st = con.createStatement();
              while (statements.hasNext()) {
                 String code = ((String) statements.next()).trim();
                 if (!code.equals("")) {
                     st.addBatch(code);
                 }
              }
              st.executeBatch();
              con.commit();
          }
          return info;
        }
        catch (SQLException e) {
            throw new WGBackendException("Cannot create database bc. of exception when executing initialisation script: " + e.getClass().getName() + " - " + e.getMessage());
        }
        finally {
            try {
                if (con != null) {
                    con.close();
                }
            }
            catch (SQLException e) {
                throw new WGBackendException("Exception when closing connection: " + e.getClass().getName() + " - " + e.getMessage());
            }
        }
    }
View Full Code Here

                catch (Exception e) {
                }
            }
        }
        catch (Exception e) {
            throw new WGBackendException("Exception fetching available databases", e);
        }
       
    }
View Full Code Here

            dir = new File(hsqlRoot);
        }
       
        if (!dir.exists()) {
            if (!dir.mkdirs()) {
                throw new WGBackendException("Cannot create hsql database directory " + dir.getPath());
            }
        }
       
        return dir;
    }
View Full Code Here

      _parent.getDb().getUserCache().clear();
      return entry;
    }
    catch (Exception e) {
            _parent.rollbackHibernateTransaction();
      throw new WGBackendException("Error creating ACL entry", e);
    }
 
  }
View Full Code Here

    try {
      Session session = _parent.getSession();
      return session.createQuery("from ACLEntry as aclentry order by aclentry.type asc, aclentry.name asc").list();
    }
    catch (HibernateException e) {
      throw new WGBackendException("Error retrieving all ACL entries", e);
    }
   
  }
View Full Code Here

      _parent.commitHibernateTransaction();
      _parent.getDb().getUserCache().clear();
    }
    catch (Exception e) {
      _parent.rollbackHibernateTransaction();
      throw new WGBackendException("Error removing ACL entry", e);
    }
 
  }
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.WGBackendException

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.