Package org.fcrepo.common

Examples of org.fcrepo.common.FaultException


                }
            }
        } catch (ValidationException e) {
            throw e;
        } catch (ServerException e) {
            throw new FaultException(e);
        }
    }
View Full Code Here


            writer.println("    <appender-ref ref=\"STDERR\"/>");
            writer.println("  </root>");
            writer.println("</configuration>");
            return tempFile;
        } catch (IOException e) {
            throw new FaultException("Error creating temporary log config file", e);
        } finally {
            if (writer != null) {
                writer.close();
            }
        }
View Full Code Here

     */
    public PolicyParser copy() {
        try {
            return new PolicyParser(m_schema);
        } catch (SAXException wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

                builder = BUILDER_FACTORY.newDocumentBuilder();
            }
            builder.setErrorHandler(new ThrowAllErrorHandler());
            return builder;
        } catch (ParserConfigurationException e) {
            throw new FaultException(e);
        }
    }
View Full Code Here

        URI resourceIdId = null;
        try {
            resourceIdType = new URI(StringAttribute.identifier);
            resourceIdId = new URI(Constants.OBJECT.PID.uri);
        } catch (URISyntaxException e) {
            throw new FaultException("Bad URI syntax", e);
        }
        EvaluationResult attribute
                = context.getResourceAttribute(resourceIdType,
                                               resourceIdId,
                                               null);
View Full Code Here

    public boolean objectExists(String objectKey) {
        try {
            return objectStore.exists(objectKey);
        } catch (LowlevelStorageException e) {
            logger.error(e.toString(),e);
            throw new FaultException(
                    "System error determining existence of blob", e);
        }
    }
View Full Code Here

                throw new RuntimeException("Missing blob after replcaing the blob: " +e.getMessage(), e);
            } catch (IOException e) { // should also never happen
                throw new RuntimeException("Error reading blob size: " +e.getMessage(), e);
            }
        } catch (DuplicateBlobException wontHappen) {
            throw new FaultException(wontHappen);
        } finally {
            closeConnection(connection);
        }
    }
View Full Code Here

        try {
            newBlob = connection.getBlob(new URI(origId + "/new"), null);
            copy(content, newBlob.openOutputStream(-1, false));
        } catch (Throwable th) {
            // any error or exception here is an unrecoverable fault
            throw new FaultException(th);
        }

        // At this point, we have origId (with old content) and origId/new

        // rename origId to origId/old
View Full Code Here

    private static Blob rename(Blob blob, String newId) {
        try {
            return blob.moveTo(new URI(newId), null);
        } catch (IOException e) {
            throw new FaultException(e);
        } catch (URISyntaxException wontHappen) {
            throw new FaultException(wontHappen);
        }
    }
View Full Code Here

    private static BlobStoreConnection getConnection(BlobStore store,
            Map<String, String> hints) {
        try {
            return store.openConnection(null, hints);
        } catch (IOException e) {
            throw new FaultException(
                    "System error getting blob store connection", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.common.FaultException

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.