Package org.apache.sling.distribution.packaging

## Interface DistributionPackage

    @ProviderType
    public interface DistributionPackage

A distribution package

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `close()` closes all resources associated with this instance
`@NotNull InputStream` `createInputStream()` creates a package stream.
`void` `delete()` releases all resources associated with this package
`@NotNull String` `getId()` get package id.
`@NotNull DistributionPackageInfo` `getInfo()` gets an additional info holder for this package.
`long` `getSize()`
`@NotNull String` `getType()` get the type of package

### Method Detail

#### getId

    @NotNull
    @NotNull String getId()

get package id. the id is a unique string that can be used to identify the package

Returns:
  the package id

#### getType

    @NotNull
    @NotNull String getType()

get the type of package

Returns:
  the package type

#### createInputStream

    @NotNull
    @NotNull InputStream createInputStream()
                                    throws IOException

creates a package stream. a new stream is created for each call and it is the caller's obligation to close the stream.

Returns:
  an `InputStream`
Throws:
  `IOException` - if stream create fails

#### getSize

    long getSize()

Returns:
  the size in bytes

#### close

    void close()

closes all resources associated with this instance

#### delete

    void delete()

releases all resources associated with this package

#### getInfo

    @NotNull
    @NotNull DistributionPackageInfo getInfo()

gets an additional info holder for this package. The additional info object contains control information rather than content information. For example info.origin can be used to skip distributing back to the originating endpoint.

Returns:
  the associated metadata to this package