code: public static void saveAll(final Object obj, final PersistenceStoreType storeType) {
  
          try {
  
              File file = new File(persistenceStorePath + File.separator + storeType);
  
              // create necessary parent directories on file system
              File directory = file.getParentFile();
              if (null != directory && !directory.exists()) {
                  directory.mkdirs();
              }
  
              log.info("aws-mock: saving to {}", file.getAbsolutePath());
  
              ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file, false));
              out.writeObject(obj);
              out.close();
          } catch (FileNotFoundException e) {
              log.error("FileNotFoundException caught during saving object to file: {}",
                      e.getMessage());
          } catch (IOException e) {
              log.error("IOException caught during saving object to file: {}", e.getMessage());
          }
  
      }
docs: Save object to the binary file defined as filename in property "persistence.store.file".
  
  @param obj            the object to save, which should be serializable
  @param storeType the store type