### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.storedprocess.metadata

# Class GenericStream

java.lang.Object
com.sas.services.storedprocess.metadata.DataSourceOrTarget
com.sas.services.storedprocess.metadata.GenericStream

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `XMLStream`

@SASScope("ALL") @BinaryCompatibilityOnly public class GenericStream extends DataSourceOrTarget implements Serializable
Describes a design time GenericStream data source or target object.

Since:
  9.2
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class com.sas.services.storedprocess.metadata.DataSourceOrTarget

  `_cultureElement, _descElement, _element, _labelElement`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericStream()`
  Constructs and empty Generic Stream Data Source or Data Target object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `allowsRewinds()`
  Describes whether the stream should allows rewinds.
  `String`
  `getExpectedContentType()`
  Returns the expected content type.
  `String`
  `getFileref()`
  Returns the SAS fileref name.
  `void`
  `setAllowRewinds(boolean allowRewinds)`
  Sets whether rewinding is supported.
  `void`
  `setExpectedContentType(String expectedContentType)`
  Sets the expected content type.
  `void`
  `setFileref(String fileref)`
  Sets the SAS fileref name.
  `void`
  `validate()`
  Validates the GenericStream.

  ### Methods inherited from class com.sas.services.storedprocess.metadata.DataSourceOrTarget

  `getDescription, getLabel, isSource, setDescription, setLabel, setSource`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GenericStream

    public GenericStream()
    Constructs and empty Generic Stream Data Source or Data Target object. By default a data source is returned and the expected content type set to "application/unknown"; a data Target can be constructed by calling `DataSourceOrTarget.setSource(boolean)`. Rewinding is only supported for data sources and can be specified via the `setAllowRewinds(boolean)` method.

- ## Method Details

  - ### getFileref

    public String getFileref()
    Returns the SAS fileref name.
    Returns:
      the SAS fileref name

  - ### getExpectedContentType

    public String getExpectedContentType()
    Returns the expected content type.
    Returns:
      the expected content type

  - ### allowsRewinds

    public boolean allowsRewinds() throws IllegalStateException
    Describes whether the stream should allows rewinds. If true, it does; if false, it does not. This setting is only valid for data sources.
    Returns:
      whether the stream allows rewinds
    Throws:
      `IllegalStateException` - if called on a data target

  - ### setFileref

    public void setFileref(String fileref)
    Sets the SAS fileref name.

  - ### setExpectedContentType

    public void setExpectedContentType(String expectedContentType)
    Sets the expected content type.

  - ### setAllowRewinds

    public void setAllowRewinds(boolean allowRewinds)
    Sets whether rewinding is supported. This setting is only valid for data sources.

  - ### validate

    public void validate() throws ServiceException
    Validates the GenericStream. There is no requirement for consumer code to call this method. The fileref is validated. The fileref should be non-empty and satisfy the requirements of `Names.validateSASFilerefName()`.
    Specified by:
      `validate` in class `DataSourceOrTarget`
    Throws:
      `ServiceException` - if validation fails