public String process() throws MergerException {
      
      validate();
      
      ObjectElement element = null;
      try {
         if (this.getInputFile().isDirectory()) {
            File[] files = this.getInputFile().listFiles();
            if (files != null) {
               for (File jsonFile : files) {
                  if (jsonFile.canRead()) {
                     logger.info("Processing file " + jsonFile.getAbsolutePath());
                     element = this.merge(new FileInputStream(jsonFile), element);
                     fileMergeCount++;
                  } else {
                     logger.warn("No read access to file " + jsonFile.getAbsolutePath() + "; skipping." );
                  }
               }
            }
         } else {
            logger.info("Processing file " + this.inputFile.getAbsolutePath());
            element = this.merge(new FileInputStream(this.inputFile));
            fileMergeCount++;
         }
         
         if (this.hasCustomRootStructName()) {
            element.setName(this.getRootStructName());
         }
         this.write(element);
         
      } catch (IOException e) {
         logger.error("", e);
         throw new MergerException(e.getMessage());
      } catch (Exception e) {
         logger.error("An error occurred during processing. " + fileMergeCount + " files were processed prior to the error.", e);
      }
      
      return this.contents;
   }