Package org.json

Examples of org.json.JSONObject.optBoolean()


         
          FileManifest fileManifest = new FileManifest();
         
          fileManifest.setRelativePath( fileObj.getString("path") );
         
          boolean isDir = fileObj.optBoolean("dir", false);
          fileManifest.setDirectory(isDir);
         
          String digest = fileObj.optString("digest",null);
          if( null != digest ) {
            fileManifest.setDigest(digest);
View Full Code Here


    // Compute url
    URL effectiveUrl = new URL(url, "_session");
   
    JSONObject response = ConnectionUtils.getJsonResource(context, effectiveUrl, JSONObject.class);
   
    boolean ok = response.optBoolean("ok",false);
    if( false == ok ){
      throw new Exception("Unable to log in with CouchDb server");
    }
  }
View Full Code Here

    // By default
    boolean result = true;
   
    if( null != options ){
      result = options.optBoolean("vetterNotificationInstant", true);
    }
   
    return result;
  }
 
View Full Code Here

    // By default
    boolean result = false;
   
    if( null != options ){
      result = options.optBoolean("vetterNotificationDaily", false);
    }
   
    return result;
  }
 
View Full Code Here

  public AtlasInfo getNunaliitAtlas(String databaseName) throws Exception {
    CouchDb db = couchClient.getDatabase(databaseName);
    JSONObject atlasDesign = db.getDocument("_design/atlas");
    JSONObject nunaliit = atlasDesign.optJSONObject("nunaliit");
    String atlasName = nunaliit.getString("name");
    boolean restricted = nunaliit.optBoolean("restricted",false);
    String submissionDbName = nunaliit.optString("submissionDbName",null);
    boolean submissionDbEnabled = nunaliit.optBoolean("submissionDbEnabled",false);
   
    AtlasInfo info = new AtlasInfo(databaseName, atlasName, restricted);
    info.setSubmissionDbName(submissionDbName);
View Full Code Here

    JSONObject atlasDesign = db.getDocument("_design/atlas");
    JSONObject nunaliit = atlasDesign.optJSONObject("nunaliit");
    String atlasName = nunaliit.getString("name");
    boolean restricted = nunaliit.optBoolean("restricted",false);
    String submissionDbName = nunaliit.optString("submissionDbName",null);
    boolean submissionDbEnabled = nunaliit.optBoolean("submissionDbEnabled",false);
   
    AtlasInfo info = new AtlasInfo(databaseName, atlasName, restricted);
    info.setSubmissionDbName(submissionDbName);
    info.setSubmissionDbEnabled(submissionDbEnabled);
View Full Code Here

   
    boolean enabled = false;
   
    JSONObject agreementInfo = agreementDoc.optJSONObject("nunaliit_user_agreement");
    if( null != agreementInfo ){
      enabled = agreementInfo.optBoolean("enabled",false);
    }
   
    return enabled;
  }
View Full Code Here

    String email_hash = ju.optString("email_hash");
    if ( email_hash != null ) {
      user.setEmailHash(email_hash);
    }
   
    Boolean provisioning_enabled = ju.optBoolean("provisioning_enabled");
    if ( provisioning_enabled != null ) {
      user.setProvisioningEnabled(provisioning_enabled);
    }
   
    Integer feeds_count = ju.optInt("feeds_count");
View Full Code Here

         
          FileManifest fileManifest = new FileManifest();
         
          fileManifest.setRelativePath( fileObj.getString("path") );
         
          boolean isDir = fileObj.optBoolean("dir", false);
          fileManifest.setDirectory(isDir);
         
          String digest = fileObj.optString("digest",null);
          if( null != digest ) {
            fileManifest.setDigest(digest);
View Full Code Here

        assertEquals(count, 1);

        final JSONObject json = repository.get("88250");
        assertNotNull(json);

        assertTrue(json.optBoolean("key3"));

    }
}
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.