docs: @Override
      public long writeData(final InputStream data) throws IOException, ResourceModelSourceException {
          if (!isDataWritable()) {
              throw new IllegalArgumentException("Cannot write to file, it is not configured to be writeable");
          }
          ResourceFormatParser resourceFormat = getResourceFormatParser();
          //validate data
          File temp = Files.createTempFile("temp", "." + resourceFormat.getPreferredFileExtension()).toFile();
          temp.deleteOnExit();
  
  
          try {
  
              try (FileOutputStream fos = new FileOutputStream(temp)) {
                  Streams.copyStream(data, fos);
              }
              final ResourceFormatParser parser = getResourceFormatParser();
              try {
                  final INodeSet set = parser.parseDocument(temp);
              } catch (ResourceFormatParserException e) {
                  throw new ResourceModelSourceException(e);
              }
              try (FileInputStream tempStream = new FileInputStream(temp)) {
                  return writeFileData(tempStream);
              }
          } finally {
              temp.delete();
          }
      }