Package com.volantis.mcs.migrate.api.framework

Examples of com.volantis.mcs.migrate.api.framework.ResourceMigrationException


            OutputStreamByteArray osba = new OutputStreamByteArray(
                    outputData.getBytes());
            osba.writeTo(output);

        } catch (IOException e) {
            throw new ResourceMigrationException("unlikely", e);
        }
    }
View Full Code Here


            Match match = type.identifyResource(meta, input);
            if (match != null) {
                if (singleMatch == null) {
                    singleMatch = match;
                } else {
                    throw new ResourceMigrationException("Duplicate " +
                            "type match: " + match.getTypeName() + ":" +
                            match.getVersionName() + " matches " +
                            singleMatch.getTypeName() + ":" +
                            singleMatch.getVersionName());
                }
View Full Code Here

                            firstException = e;
                        }
                    }
                }
                if (firstException != null) {
                    throw new ResourceMigrationException(
                            "Error processing type " + match.getTypeName() +
                            ", step " + step, firstException);
                }
            }
View Full Code Here

        // allow it to be used.
        //        transformerMetaFactory.createXsltcTransformerFactory();

        URL xslURL = getClass().getResource(xslResourcePath);
        if (xslURL == null) {
            throw new ResourceMigrationException(
                    "Could not find " + xslResourcePath);
        }

        Source source = new StreamSource(xslURL.toExternalForm());
        try {
            templates = transformerFactory.newTemplates(source);
        } catch (TransformerConfigurationException e) {
            throw new ResourceMigrationException(
                    "Cannot create XSLT transformer", e);
        }

        // Default to Strict mode if not set.
        this.strictMode = true;
View Full Code Here

                                    NotificationType.ERROR,
                                    "unexpected-exception", e);
                        reporter.reportNotification(notification);
                    } else {
                        // Validation errors are fatal since we introduced them.
                        throw new ResourceMigrationException(e);
                    }
                } catch (IOException e) {
                    // Should never get an IO error since we are reading from memory
                    throw new ResourceMigrationException(e);
                }
            }

        } catch (TransformerConfigurationException tce) {
            throw new ResourceMigrationException(
                "Cannot create XSLT transformer", tce);
        } catch (TransformerException te) {
            throw new ResourceMigrationException("XSLT Transformation failed", te);
        } catch (SAXException e) {
            throw new ResourceMigrationException(e);
        }
    }
View Full Code Here

        if (applyPathRecognition) {
            if (pathRecogniser != null) {
                try {
                    recognisedPath = pathRecogniser.recognisePath(meta.getURI());
                } catch (ResourceMigrationException e) {
                    throw new ResourceMigrationException("Error recognising path " +
                            "for type " + getName(), e);
                }
            }
            // else, user has asked for path recognition but this type does not
            // support it, so we skip it. This just means that things run a bit
            // slower.
            // todo: add a debug log here? does this use notification?
        }

        if (recognisedPath || !applyPathRecognition) {

            Version identifiedVersion = null;
            Iterator contentRecognisersIterator = contentIdentifiers.iterator();
            while (contentRecognisersIterator.hasNext()) {
                input.restart();
                ContentIdentifier contentRecogniser =
                        (ContentIdentifier) contentRecognisersIterator.next();

                // todo: later: potentially a recognition exception should not
                // always be fatal. It may be that there are multiple
                // recognisers for a path and that one of the ones that throws
                // an exception is not the one that actually recognises the
                // content. In this case we could log the error, continue on,
                // and only fail if there is no match in the end.
                boolean identifiedContent;
                try {
                    identifiedContent = contentRecogniser.identifyContent(input);
                } catch (Exception e) {
                    throw new ResourceMigrationException("Error identifying " +
                            "content for type " + getName() + " version " +
                            contentRecogniser.getVersion().getName(), e);
                }

                if (identifiedContent) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.migrate.api.framework.ResourceMigrationException

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.