Package org.apache.chemistry.opencmis.commons.exceptions

Examples of org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException


        // parse new entry
        AtomEntry entry = parse(resp.getStream(), AtomEntry.class);

        // we expect a CMIS entry
        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        // set object id
        objectId.setValue(entry.getId());
View Full Code Here


        if (obj instanceof Map) {
            return (Map<String, Object>) obj;
        }

        throw new CmisConnectionException("Unexpected object!");
    }
View Full Code Here

        if (obj instanceof List) {
            return (List<Object>) obj;
        }

        throw new CmisConnectionException("Unexpected object!");
    }
View Full Code Here

        try {
            reader = new InputStreamReader(stream, charset);
            JSONParser parser = new JSONParser();
            obj = parser.parse(reader, containerFactory);
        } catch (Exception e) {
            throw new CmisConnectionException("Parsing exception!", e);
        } finally {
            try {
                char[] buffer = new char[4096];
                while (reader.read(buffer) > -1) {
                }
View Full Code Here

                if (ri instanceof RepositoryInfoBrowserBindingImpl) {
                    String repositoryUrl = ((RepositoryInfoBrowserBindingImpl) ri).getRepositoryUrl();
                    String rootUrl = ((RepositoryInfoBrowserBindingImpl) ri).getRootUrl();

                    if (id == null || repositoryUrl == null || rootUrl == null) {
                        throw new CmisConnectionException("Found invalid Repository Info! (id: " + id + ")");
                    }

                    getRepositoryUrlCache().addRepository(id, repositoryUrl, rootUrl);
                }

                if (repositoryId == null || repositoryId.equals(id)) {
                    repInfos.add(ri);
                }
            } else {
                throw new CmisConnectionException("Found invalid Repository Info!");
            }
        }

        return repInfos;
    }
View Full Code Here

                } else if (he.getStatusCode() == 407) {
                    throw new CmisProxyAuthenticationException(message, e);
                }
            }

            throw new CmisConnectionException(message, e);
        }

        return serviceObject;
    }
View Full Code Here

                ((BindingProvider) portObject).getRequestContext().put("com.sun.xml.ws.request.timeout", readTimeout);
            }
        } catch (CmisBaseException ce) {
            throw ce;
        } catch (Exception e) {
            throw new CmisConnectionException("Cannot initalize Web Services port object: " + e.getMessage(), e);
        }

        return portObject;
    }
View Full Code Here

        URI uri;
        try {
            uri = new URI(url);
        } catch (URISyntaxException e) {
            throw new CmisConnectionException(e.getMessage(), e);
        }

        lock.writeLock().lock();
        try {
            List<CmisHttpCookie> cookies = store.get(uri);
View Full Code Here

        URI uri;
        try {
            uri = new URI(url);
        } catch (URISyntaxException e) {
            throw new CmisConnectionException(e.getMessage(), e);
        }

        lock.writeLock().lock();
        try {
            // parse and construct cookies according to the map
View Full Code Here

        AtomPubParser parser = new AtomPubParser(stream);

        try {
            parser.parse();
        } catch (Exception e) {
            throw new CmisConnectionException("Parsing exception!", e);
        }

        AtomBase parseResult = parser.getResults();

        if (!clazz.isInstance(parseResult)) {
            throw new CmisConnectionException("Unexpected document! Received "
                    + (parseResult == null ? "something unknown" : parseResult.getType()) + "!");
        }

        return (T) parseResult;
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException

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.