private File copyRemoteInputStreamToTempFile(String className, String remoteInputStreamName,
      RemoteInputStream remoteInputStream, Path tempDir) {
    if (!isJar(remoteInputStreamName) && className.contains(".")) {
      File packageDir = new File(tempDir.toFile(), className.replace(".", "/")).getParentFile();
      packageDir.mkdirs();
      tempDir = packageDir.toPath();
    }
    try {
      Path tempPdxClassFile = Paths.get(tempDir.toString(), remoteInputStreamName);
      try (InputStream input = RemoteInputStreamClient.wrap(remoteInputStream);
          FileOutputStream output = new FileOutputStream(tempPdxClassFile.toString())) {
        copyFile(input, output);
      }
      return tempPdxClassFile.toFile();
    } catch (IOException iox) {
      throw new JdbcConnectorException(
          "The pdx class file \"" + remoteInputStreamName
              + "\" could not be copied to a temporary file, because: " + iox);
    }
  }
Generates and returns a PdxType for the given class.
The generated PdxType is also stored in the TypeRegistry.

@param cache used to generate pdx type
@param clazz the class to generate a PdxType for
@return the generated PdxType
@throws JdbcConnectorException if a PdxType can not be generated
geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingPreconditionCheckFunction.java