Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.GeneralException


        } catch (AuthzException ae) {
            throw ae;
        } catch (Throwable th) {
            String msg = "Error describing repository";
            logger.error(msg, th);
            throw new GeneralException(msg, th);
        } finally {
            try {
                if (pr != null) {
                    pr.close();
                }
View Full Code Here


                                          new StreamResult(out));
                }
                out.flush();

            } else {
                throw new GeneralException("No object history returned");
            }
        } catch (ServerException e) {
            throw e;
        } catch (Throwable th) {
            String msg = "Error getting object history";
            throw new GeneralException(msg, th);
        } finally {
            try {
                if (pr != null) {
                    pr.close();
                }
View Full Code Here

            if (subject.startsWith(Constants.FEDORA.uri)) {
                // pid is everything after the first / to the 2nd / or to the end of the string
                return subject.split("/", 3)[1];

            } else {
                throw new GeneralException("Subject URI must be in the " + Constants.FEDORA.uri + " scheme.");
            }

        }
View Full Code Here

                        + uee.getClass().getName() + "\"  . The "
                        + "Reason was \"" + uee.getMessage()
                        + "\"  . String value: " + drc.DSLocation
                        + "  . ";
                logger.error(message);
                throw new GeneralException(message);
            }
        }
        long stopTime = new Date().getTime();
        long interval = stopTime - startTime;
        logger.debug("Roundtrip getDatastreamDissemination: " + interval
View Full Code Here

                return getFromFilesystem(params);
            }
            if (params.getProtocol().equals("http") || params.getProtocol().equals("https")){
                return getFromWeb(params);
            }
            throw new GeneralException("protocol for retrieval of external content not supported. URL: " + params.getUrl());
        } catch (Exception ex) {
            // catch anything but generalexception
            ex.printStackTrace();
            throw new HttpServiceNotFoundException("[" + this.getClass().getSimpleName() + "] "
                    + "returned an error.  The underlying error was a "
View Full Code Here

            if (mimeType == null || mimeType.equals("")) {
                mimeType = DEFAULT_MIMETYPE;
            }
            return new MIMETypedStream(mimeType, response, headerArray, length);
        } catch (Exception e) {
            throw new GeneralException("Error getting " + url, e);
        }
    }
View Full Code Here

            URI cURI = cFile.toURI();
            logger.info("Checking resolution security on " + cURI);
            Authorization authModule = getServer()
                    .getBean("org.fcrepo.server.security.Authorization", Authorization.class);
            if (authModule == null) {
                throw new GeneralException(
                "Missing required Authorization module");
            }
            authModule.enforceRetrieveFile(params.getContext(), cURI.toString());
            // end security check
            String mimeType = params.getMimeType();
View Full Code Here

    public static Date getCurrentDate(Context context) throws GeneralException {

        String propName = Constants.ENVIRONMENT.CURRENT_DATE_TIME.uri;
        String dateTimeValue = context.getEnvironmentValue(propName);
        if (dateTimeValue == null) {
            throw new GeneralException("Missing value for environment "
                    + "context attribute: " + propName);
        }

        try {
            return DateUtility.parseDateStrict(dateTimeValue);
        } catch (ParseException e) {
            throw new GeneralException(e.getMessage());
        }
    }
View Full Code Here

            throws ServerException {
        DigitalObject obj = getObject(pid);
        //TODO hasModel
        if (!obj.hasContentModel(
                                 Models.SERVICE_DEPLOYMENT_3_0)) {
            throw new GeneralException("Not a service deployment: " + pid);
        } else {
            return new SimpleServiceDeploymentReader(null,
                                                     this,
                                                     null,
                                                     null,
View Full Code Here

            throws ServerException {
        DigitalObject obj = getObject(pid);
        //TODO hasModel
        if (!obj.hasContentModel(
                                 Models.SERVICE_DEFINITION_3_0)) {
            throw new GeneralException("Not a service definition object: "
                    + pid);
        } else {
            return new SimpleServiceDefinitionReader(null,
                                                     this,
                                                     null,
View Full Code Here

TOP

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

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.