Search in sources :

Example 1 with NoCacheInputStream

use of org.commonjava.maven.galley.io.nocache.NoCacheInputStream in project galley by Commonjava.

the class NoCacheTransferDecorator method decorateRead.

@Override
public InputStream decorateRead(final InputStream stream, final Transfer transfer, final EventMetadata eventMetadata) throws IOException {
    SpecialPathInfo specialPathInfo = specialPathManager.getSpecialPathInfo(transfer, eventMetadata.getPackageType());
    logger.trace("SpecialPathInfo for: {} is: {} (cachable? {})", transfer, specialPathInfo, (specialPathInfo == null ? true : specialPathInfo.isCachable()));
    if (specialPathInfo != null && !specialPathInfo.isCachable()) {
        logger.trace("Decorating read with NoCacheTransferDecorator for: {}", transfer);
        return new NoCacheInputStream(stream, transfer);
    }
    return stream;
}
Also used : NoCacheInputStream(org.commonjava.maven.galley.io.nocache.NoCacheInputStream) SpecialPathInfo(org.commonjava.maven.galley.model.SpecialPathInfo)

Aggregations

NoCacheInputStream (org.commonjava.maven.galley.io.nocache.NoCacheInputStream)1 SpecialPathInfo (org.commonjava.maven.galley.model.SpecialPathInfo)1