Package org.apache.sling.ide.osgi

Examples of org.apache.sling.ide.osgi.OsgiClientException


                }
            }

            return null;
        } catch (HttpException e) {
            throw new OsgiClientException(e);
        } catch (IOException e) {
            throw new OsgiClientException(e);
        } catch (JSONException e) {
            throw new OsgiClientException(e);
        } finally {
            IOUtils.closeQuietly(input);
            method.releaseConnection();
        }
    }
View Full Code Here


            filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams()));

            int status = getHttpClient().executeMethod(filePost);
            if (status != 200) {
                throw new OsgiClientException("Method execution returned status " + status);
            }
        } catch (IOException e) {
            throw new OsgiClientException(e);
        } finally {
            filePost.releaseConnection();
        }
    }
View Full Code Here

                int status = httpClient.executeMethod(method);
                if (status != 200) {
                    try {
                        JSONObject result = parseResult(method);
                        if (result.has("message")) {
                            throw new OsgiClientException(result.getString("message"));
                        }
                    } catch (JSONException e) {
                        // ignore, fallback to status code reporting
                    }
                    throw new OsgiClientException("Method execution returned status " + status);
                }

                JSONObject obj = parseResult(method);

                if ("OK".equals(obj.getString("status"))) {
                    return;
                }

                String errorMessage = obj.has("message") ? "Bundle deployment failed, please check the Sling logs"
                        : obj.getString("message");

                throw new OsgiClientException(errorMessage);

            } catch (IOException e) {
                throw new OsgiClientException(e);
            } catch (JSONException e) {
                throw new OsgiClientException(
                        "Response is not valid JSON. The InstallServlet is probably not installed at the expected location",
                        e);
            } finally {
                method.releaseConnection();
            }
View Full Code Here

TOP

Related Classes of org.apache.sling.ide.osgi.OsgiClientException

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.