Package io.lumify.core.exception

Examples of io.lumify.core.exception.LumifyException


    protected String getUsername(X509Certificate cert) {
        String dn = getDn(cert);
        if (dn != null) {
            return dn;
        } else {
            throw new LumifyException("failed to get DN from cert for username");
        }
    }
View Full Code Here


    protected String getDisplayName(X509Certificate cert) {
        String cn = getCn(cert);
        if (cn != null) {
            return cn;
        } else {
            throw new LumifyException("failed to get CN from cert for displayName");
        }
    }
View Full Code Here

            sb.append(XML_DECLARATION).append(LINE_SEPARATOR);
            sb = appendComments(sb, comments);
            sb.append(getXmlMapper().writeValueAsString(chart));
            return sb.toString();
        } catch (JsonProcessingException e) {
            throw new LumifyException("exception while generating XML", e);
        }
    }
View Full Code Here

    private String getWorkspaceId(File file) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader(file));
        String workspaceLine = in.readLine();
        Matcher m = Pattern.compile(".*\"id\":\"(.*?)\".*").matcher(workspaceLine);
        if (!m.matches()) {
            throw new LumifyException("Could not find Workspace id in line: " + workspaceLine);
        }
        return m.group(1);
    }
View Full Code Here

    protected String[] getRequiredParameterArray(HttpServletRequest request, String parameterName) {
        Preconditions.checkNotNull(request, "The provided request was invalid");

        String[] value = request.getParameterValues(parameterName);
        if (value == null) {
            throw new LumifyException(String.format("Parameter: '%s' is required in the request", parameterName));
        }
        return value;
    }
View Full Code Here

    private String getParameter(final HttpServletRequest request, final String parameterName, final boolean optional) {
        final String paramValue = request.getParameter(parameterName);

        if (paramValue == null) {
            if (!optional) {
                throw new LumifyException(String.format("Parameter: '%s' is required in the request", parameterName));
            }

            return null;
        }
View Full Code Here

    }

    protected String getActiveWorkspaceId(final HttpServletRequest request) {
        String workspaceId = getWorkspaceIdOrDefault(request);
        if (workspaceId == null || workspaceId.trim().length() == 0) {
            throw new LumifyException(LUMIFY_WORKSPACE_ID_HEADER_NAME + " is a required header.");
        }
        return workspaceId;
    }
View Full Code Here

        try {
            MessageDigest digest = MessageDigest.getInstance("MD5");
            byte[] md5 = digest.digest(data);
            return Hex.encodeHexString(md5);
        } catch (NoSuchAlgorithmException e) {
            throw new LumifyException("Could not find MD5", e);
        }
    }
View Full Code Here

        }
        try {
            String jsonObject = objectMapper.writeValueAsString(obj);
            configureResponse(ResponseTypes.JSON_OBJECT, response, jsonObject);
        } catch (JsonProcessingException e) {
            throw new LumifyException("Could not write json", e);
        }
    }
View Full Code Here

        this.workQueueRepository = workQueueRepository;
        this.auditRepository = auditRepository;

        this.entityHasImageIri = this.getConfiguration().get(Configuration.ONTOLOGY_IRI_ENTITY_HAS_IMAGE);
        if (this.entityHasImageIri == null) {
            throw new LumifyException("Could not find configuration for " + Configuration.ONTOLOGY_IRI_ENTITY_HAS_IMAGE);
        }

        this.artifactContainsImageOfEntityIri = this.getConfiguration().get(Configuration.ONTOLOGY_IRI_ARTIFACT_CONTAINS_IMAGE_OF_ENTITY);
        if (this.artifactContainsImageOfEntityIri == null) {
            throw new LumifyException("Could not find configuration for " + Configuration.ONTOLOGY_IRI_ARTIFACT_CONTAINS_IMAGE_OF_ENTITY);
        }
    }
View Full Code Here

TOP

Related Classes of io.lumify.core.exception.LumifyException

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.