private void generate(DiskStore ds) throws SAXException {
    if (version.compareTo(CacheXmlVersion.GEMFIRE_6_5) < 0) {
      return;
    }
    AttributesImpl atts = new AttributesImpl();
    try {
      atts.addAttribute("", "", NAME, "", ds.getName());

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasAutoCompact())) {
        if (generateDefaults() || ds.getAutoCompact() != DiskStoreFactory.DEFAULT_AUTO_COMPACT) {
          atts.addAttribute("", "", AUTO_COMPACT, "", String.valueOf(ds.getAutoCompact()));
        }
      }

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasAllowForceCompaction())) {
        if (generateDefaults()
            || ds.getAllowForceCompaction() != DiskStoreFactory.DEFAULT_ALLOW_FORCE_COMPACTION) {
          atts.addAttribute("", "", ALLOW_FORCE_COMPACTION, "",
              String.valueOf(ds.getAllowForceCompaction()));
        }
      }

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasCompactionThreshold())) {
        if (generateDefaults()
            || ds.getCompactionThreshold() != DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD) {
          atts.addAttribute("", "", COMPACTION_THRESHOLD, "",
              String.valueOf(ds.getCompactionThreshold()));
        }
      }

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasMaxOplogSize())) {
        if (generateDefaults() || ds.getMaxOplogSize() != DiskStoreFactory.DEFAULT_MAX_OPLOG_SIZE) {
          atts.addAttribute("", "", MAX_OPLOG_SIZE, "", String.valueOf(ds.getMaxOplogSize()));
        }
      }

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasTimeInterval())) {
        if (generateDefaults() || ds.getTimeInterval() != DiskStoreFactory.DEFAULT_TIME_INTERVAL) {
          atts.addAttribute("", "", TIME_INTERVAL, "", String.valueOf(ds.getTimeInterval()));
        }
      }

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasWriteBufferSize())) {
        if (generateDefaults()
            || ds.getWriteBufferSize() != DiskStoreFactory.DEFAULT_WRITE_BUFFER_SIZE) {
          atts.addAttribute("", "", WRITE_BUFFER_SIZE, "", String.valueOf(ds.getWriteBufferSize()));
        }
      }

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasQueueSize())) {
        if (generateDefaults() || ds.getQueueSize() != DiskStoreFactory.DEFAULT_QUEUE_SIZE) {
          atts.addAttribute("", "", QUEUE_SIZE, "", String.valueOf(ds.getQueueSize()));
        }
      }

      if (version.compareTo(CacheXmlVersion.GEMFIRE_8_0) >= 0) {
        if ((!(ds instanceof DiskStoreAttributesCreation)
            || ((DiskStoreAttributesCreation) ds).hasDiskUsageWarningPercentage())) {
          if (generateDefaults() || ds
              .getDiskUsageWarningPercentage() != DiskStoreFactory.DEFAULT_DISK_USAGE_WARNING_PERCENTAGE) {
            atts.addAttribute("", "", DISK_USAGE_WARNING_PERCENTAGE, "",
                String.valueOf(ds.getDiskUsageWarningPercentage()));
          }
        }

        if ((!(ds instanceof DiskStoreAttributesCreation)
            || ((DiskStoreAttributesCreation) ds).hasDiskUsageCriticalPercentage())) {
          if (generateDefaults() || ds
              .getDiskUsageCriticalPercentage() != DiskStoreFactory.DEFAULT_DISK_USAGE_CRITICAL_PERCENTAGE) {
            atts.addAttribute("", "", DISK_USAGE_CRITICAL_PERCENTAGE, "",
                String.valueOf(ds.getDiskUsageCriticalPercentage()));
          }
        }
      }
    } finally {
      handler.startElement("", DISK_STORE, DISK_STORE, atts);

      if ((!(ds instanceof DiskStoreAttributesCreation)
          || ((DiskStoreAttributesCreation) ds).hasDiskDirs())) {
        File[] diskDirs = ds.getDiskDirs();
        int[] diskSizes = ds.getDiskDirSizes();
        if (diskDirs != null && diskDirs.length > 0) {
          if (generateDefaults() || !Arrays.equals(diskDirs, DefaultDiskDirs.getDefaultDiskDirs())
              || !Arrays.equals(diskSizes, DiskStoreFactory.DEFAULT_DISK_DIR_SIZES)) {
            handler.startElement("", DISK_DIRS, DISK_DIRS, EMPTY);
            for (int i = 0; i < diskDirs.length; i++) {
              AttributesImpl diskAtts = new AttributesImpl();
              if (diskSizes[i] != DiskStoreFactory.DEFAULT_DISK_DIR_SIZE) {
                diskAtts.addAttribute("", "", DIR_SIZE, "", String.valueOf(diskSizes[i]));
              }
              handler.startElement("", DISK_DIR, DISK_DIR, diskAtts);
              File dir = diskDirs[i];
              String name = generateDefaults() ? dir.getAbsolutePath() : dir.getPath();
              handler.characters(name.toCharArray(), 0, name.length());
              handler.endElement("", DISK_DIR, DISK_DIR);
            }
            handler.endElement("", DISK_DIRS, DISK_DIRS);
          }
        }
      }

      handler.endElement("", "", DISK_STORE);
    }
  }
Generates XML for the given disk store

@since GemFire prPersistSprint2
geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java