Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.LowlevelStorageException


                    } catch (IOException e) {
                        if (report != NO_REPORT) {
                            logger.error("couldn't get File path", e);
                        }
                        if (stopOnError) {
                            throw new LowlevelStorageException(true,
                                                               "couldn't get File path",
                                                               e);
                        }
                    }
                    if (path != null) {
                        String pid = PathAlgorithm.decode(filename);
                        if (pid == null) {
                            if (report != NO_REPORT) {
                                logger.error("unexpected file at [" + path + "]");
                            }
                            if (stopOnError) {
                                throw new LowlevelStorageException(true,
                                                                   "unexpected file traversing object store at ["
                                                                           + path
                                                                           + "]");
                            }
                        } else {
View Full Code Here


            files = new File[storeBases.length];
            for (int i = 0; i < storeBases.length; i++) {
                files[i] = new File(storeBases[i]);
            }
        } catch (Exception e) {
            throw new LowlevelStorageException(true,
                                               "couldn't rebuild VolatilePathRegistry",
                                               e);
        }
        traverseFiles(files, operation, stopOnError, report);
    }
View Full Code Here

            statement.setString(1,pid);
            rs =
                    statement.executeQuery();
            return rs.next();
        } catch (SQLException e1) {
            throw new LowlevelStorageException(true, "sql failure (get)", e1);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
                if (statement != null) {
                    statement.close();
                }
                if (connection != null) {
                    connectionPool.free(connection);
                }
            } catch (Exception e2) { // purposely general to include uninstantiated statement, connection
                throw new LowlevelStorageException(true,
                                                   "sql failure closing statement, connection, pool (get)",
                                                   e2);
            } finally {
                rs = null;
                statement = null;
View Full Code Here

            if (path == null || path.length() == 0) {
                throw new LowlevelStorageInconsistencyException("[" + pid
                        + "] has -null- path in db registry");
            }
        } catch (SQLException e1) {
            throw new LowlevelStorageException(true, "sql failure (get)", e1);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
                if (statement != null) {
                    statement.close();
                }
                if (connection != null) {
                    connectionPool.free(connection);
                }
            } catch (Exception e2) { // purposely general to include uninstantiated statement, connection
                throw new LowlevelStorageException(true,
                                                   "sql failure closing statement, connection, pool (get)",
                                                   e2);
            } finally {
                rs = null;
                statement = null;
View Full Code Here

        }
        if (updateCount > 1) {
          throw new LowlevelStorageInconsistencyException("-multiple- rows updated in db registry");
        }
        } catch (SQLException e1) {
            throw new LowlevelStorageException(true, "sql failurex (exec)", e1);
        }
    }
View Full Code Here

        statement = connection.prepareStatement(sql);
        if (pid != null){
          statement.setString(1,pid);
        }
        if (statement.execute()) {
          throw new LowlevelStorageException(true,
          "sql returned query results for a nonquery");
        }
        ensureSingleUpdate(statement);
      } catch (SQLException e1) {
        throw new LowlevelStorageException(true, "sql failurex (exec)", e1);
      } finally {
        try {
          if (statement != null) {
            statement.close();
          }
          if (connection != null) {
            connectionPool.free(connection);
          }
        } catch (Exception e2) { // purposely general to include uninstantiated statement, connection
          throw new LowlevelStorageException(true,
              "sql failure closing statement, connection, pool (exec)",
              e2);
        } finally {
          statement = null;
                connection = null;
View Full Code Here

            logger.info("end rebuilding registry from files (ending normally)");
        } catch (Exception e) {
            if (report != NO_REPORT) {
                logger.error("ending rebuild unsuccessfully", e);
            }
            throw new LowlevelStorageException(true,
                                               "ending rebuild unsuccessfully",
                                               e); //<<====
        }
    }
View Full Code Here

                writer.println(key);
            }
            writer.close();
            return new KeyEnumeration(tempFile);
        } catch (Exception e) {
            throw new LowlevelStorageException(true, "Unexpected error", e);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
                if (statement != null) {
                    statement.close();
                }
                if (connection != null) {
                    connectionPool.free(connection);
                }
            } catch (Exception e) {
                throw new LowlevelStorageException(true, "Unexpected error", e);
            } finally {
                if (writer != null) {
                    writer.close();
                    writer = null;
                }
View Full Code Here

                        + unencoded.substring(i);
            } else {
                return Server.getPID(unencoded).toFilename();
            }
        } catch (MalformedPidException e) {
            throw new LowlevelStorageException(true, e.getMessage(), e);
        }
    }
View Full Code Here

                        + encoded.substring(i);
            } else {
                return Server.pidFromFilename(encoded).toString();
            }
        } catch (MalformedPidException e) {
            throw new LowlevelStorageException(true, e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.LowlevelStorageException

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.