Package net.sf.json

Examples of net.sf.json.JSONObject.optString()


        keepDependencies = req.getParameter("keepDependencies") != null;

        try {
            JSONObject json = req.getSubmittedForm();

            setDisplayName(json.optString("displayNameOrNull"));

            if (req.getParameter("logrotate") != null)
                logRotator = LogRotator.DESCRIPTOR.newInstance(req,json.getJSONObject("logrotate"));
            else
                logRotator = null;
View Full Code Here


            o.writeCanonical(new OutputStreamWriter(new TeeOutputStream(dos,sos),"UTF-8")).close();

            // did the digest match? this is not a part of the signature validation, but if we have a bug in the c14n
            // (which is more likely than someone tampering with update center), we can tell
            String computedDigest = new String(Base64.encode(sha1.digest()));
            String providedDigest = signature.optString("correct_digest");
            if (providedDigest==null) {
                return FormValidation.error("No correct_digest parameter in update center '"+id+"'. This metadata appears to be old.");
            }
            if (!computedDigest.equalsIgnoreCase(providedDigest)) {
                return FormValidation.error("Digest mismatch: "+computedDigest+" vs "+providedDigest+" in update center '"+id+"'");
View Full Code Here

    //log.debug("data is:" + msg);
    //System.out.println("data is:");
    //System.out.println(msg);
    JSONObject json = JSONObject.fromString(msg);
    logMessage = new LogMessage();
    logMessage.setLocation(json.optString("location"));
    logMessage.setMessageBody(json.optString("messageBody"));
    logMessage.setTimestamp(json.optString("timestamp"));
    logMessage.setLogLevel(json.optInt("logLevel"));

    Object object = json.opt("messageObject");
View Full Code Here

    //System.out.println("data is:");
    //System.out.println(msg);
    JSONObject json = JSONObject.fromString(msg);
    logMessage = new LogMessage();
    logMessage.setLocation(json.optString("location"));
    logMessage.setMessageBody(json.optString("messageBody"));
    logMessage.setTimestamp(json.optString("timestamp"));
    logMessage.setLogLevel(json.optInt("logLevel"));

    Object object = json.opt("messageObject");
    //System.out.println("message object type = " + json.opt("messageObject").getClass());
View Full Code Here

    //System.out.println(msg);
    JSONObject json = JSONObject.fromString(msg);
    logMessage = new LogMessage();
    logMessage.setLocation(json.optString("location"));
    logMessage.setMessageBody(json.optString("messageBody"));
    logMessage.setTimestamp(json.optString("timestamp"));
    logMessage.setLogLevel(json.optInt("logLevel"));

    Object object = json.opt("messageObject");
    //System.out.println("message object type = " + json.opt("messageObject").getClass());
    //System.out.println("message object = " + json.opt("messageObject"));
View Full Code Here

    JSONObject submittedObj = conversionContext.getAttachmentDescription();
   
    if( null == submittedObj) {
      logger.info("Submission can not be found");

    } else if( false == UploadConstants.UPLOAD_STATUS_SUBMITTED.equals( submittedObj.optString(UploadConstants.UPLOAD_STATUS_KEY) ) ) {
      logger.info("File not in submit state");
     
    } else {
      JSONObject originalObj = submittedObj.optJSONObject("original");
     
View Full Code Here

    JSONObject analyzedObj = conversionContext.getAttachmentDescription();
   
    if( null == analyzedObj ) {
      logger.info("Analysis object not found");

    } else if( false == UploadConstants.UPLOAD_STATUS_ANALYZED.equals( analyzedObj.optString(UploadConstants.UPLOAD_STATUS_KEY) ) ) {
      logger.info("File not in analyzed state");
     
    } else {
      JSONObject originalObj = analyzedObj.optJSONObject("original");
      if( null == originalObj ) {
View Full Code Here

    JSONObject approvedObj = conversionContext.getAttachmentDescription();

    if( null == approvedObj ) {
      logger.info("Approved object not found");

    } else if( false == UploadConstants.UPLOAD_STATUS_APPROVED.equals( approvedObj.optString(UploadConstants.UPLOAD_STATUS_KEY) ) ) {
      logger.info("File not in analyzed state");
     
    } else {

      boolean pluginFound = false;
View Full Code Here

  public File getFile() {
    File file = null;
   
    JSONObject descriptionObj = getAttachmentDescription();
    if( null != descriptionObj ) {
      String mediaFileName = descriptionObj.optString(UploadConstants.MEDIA_FILE_KEY);
      if( null != mediaFileName ) {
        file = new File(mediaDir, mediaFileName);
      }
    }
   
View Full Code Here

   
    JSONObject descriptionObj = getAttachmentDescription();
    if( null != descriptionObj ) {
      JSONObject originalObj = descriptionObj.optJSONObject("original");
      if( null != originalObj ) {
        String mediaFileName = originalObj.optString(UploadConstants.MEDIA_FILE_KEY);
        if( null != mediaFileName ) {
          file = new File(mediaDir, mediaFileName);
        }
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.