org.commonjava.maven.galley.model.Transfer.openInputStream()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.commonjava.maven.galley.model.Transfer.openInputStream()方法的一些代码示例,展示了Transfer.openInputStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transfer.openInputStream()方法的具体详情如下:
包路径:org.commonjava.maven.galley.model.Transfer
类名称:Transfer
方法名:openInputStream

Transfer.openInputStream介绍

暂无

代码示例

代码示例来源:origin: org.commonjava.aprox/aprox-promote-common

@Override
public InputStream openInputStream( boolean fireEvents, EventMetadata eventMetadata )
    throws IOException
{
  return delegate.openInputStream( fireEvents, eventMetadata );
}

代码示例来源:origin: org.commonjava.aprox/aprox-promote-common

@Override
public InputStream openInputStream()
    throws IOException
{
  return delegate.openInputStream();
}

代码示例来源:origin: org.commonjava.aprox/aprox-promote-common

@Override
public InputStream openInputStream( boolean fireEvents )
    throws IOException
{
  return delegate.openInputStream( fireEvents );
}

代码示例来源:origin: org.commonjava.aprox/aprox-bindings-jaxrs

@Override
public void write( final OutputStream out )
  throws IOException, WebApplicationException
{
  InputStream in = null;
  try
  {
    in = item.openInputStream( true, eventMetadata );
    IOUtils.copy( in, out );
  }
  finally
  {
    IOUtils.closeQuietly( in );
  }
}

代码示例来源:origin: org.commonjava.maven.galley/galley-api

public InputStream openInputStream()
  throws IOException
{
  return openInputStream( true, new EventMetadata() );
}

代码示例来源:origin: org.commonjava.maven.galley/galley-api

public InputStream openInputStream( final boolean fireEvents )
  throws IOException
{
  return openInputStream( fireEvents, new EventMetadata() );
}

代码示例来源:origin: org.commonjava.indy/indy-core

try
  raw = item.openInputStream( false );
  final int read = raw.read( head );
  if ( read > 0 )

代码示例来源:origin: org.commonjava.aprox/aprox-core

try
  raw = item.openInputStream( false );
  final int read = raw.read( head );
  if ( read > 0 )

代码示例来源:origin: org.commonjava.indy/indy-core

private HttpExchangeMetadata readExchangeMetadata( final Transfer meta )
    throws IndyWorkflowException
{
  logger.trace( "Reading HTTP exchange metadata from: {}", meta );
  if ( meta != null && meta.exists() )
  {
    try(InputStream stream = meta.openInputStream( false ))
    {
      String raw = IOUtils.toString( stream );
      logger.trace( "HTTP Metadata string is:\n\n{}\n\n", raw );
      return mapper.readValue( raw, HttpExchangeMetadata.class );
    }
    catch ( final IOException e )
    {
      throw new IndyWorkflowException( "HTTP exchange metadata appears to be damaged: %s. Reason: %s", e,
                       meta, e.getMessage() );
    }
  }
  else
  {
    logger.trace( "Cannot read HTTP exchange: {}. Transfer is missing!", meta );
  }
  return null;
}

代码示例来源:origin: org.commonjava.aprox/aprox-core

private HttpExchangeMetadata readExchangeMetadata( final Transfer meta )
    throws AproxWorkflowException
{
  if ( meta != null && meta.exists() )
  {
    InputStream stream = null;
    try
    {
      stream = meta.openInputStream( false );
      return mapper.readValue( stream, HttpExchangeMetadata.class );
    }
    catch ( final IOException e )
    {
      throw new AproxWorkflowException( "HTTP exchange metadata appears to be damaged: %s. Reason: %s", e,
                       meta, e.getMessage() );
    }
    finally
    {
      IOUtils.closeQuietly( stream );
    }
  }
  return null;
}

代码示例来源:origin: org.commonjava.aprox/aprox-core

stream = txfr.openInputStream( false );

代码示例来源:origin: org.commonjava.aprox/aprox-depgraph-common

try
  itemStream = item.openInputStream();
  copy( itemStream, stream );

代码示例来源:origin: org.commonjava.indy/indy-pkg-npm-common

stream = src.openInputStream();
String content = IOUtils.toString( stream );
logger.debug( "[NPM] Adding in metadata content from: {}\n\n{}\n\n", src, content );

代码示例来源:origin: org.commonjava.aprox/aprox-indexer

@Override
public InputStream retrieve( final String name )
  throws IOException, FileNotFoundException
{
  final String path = "/.index/" + name;
  try
  {
    logger.info( "Retrieving: '{}' from store: {}", path, store.getKey() );
    final Transfer item = fileManager.retrieve( store, path, new EventMetadata() );
    if ( item == null || !item.exists() )
    {
      throw new FileNotFoundException( path );
    }
    return item.openInputStream();
  }
  catch ( final AproxWorkflowException e )
  {
    logger.error( String.format( "Failed to retrieve: %s from: %s. Reason: %s", path, store.getKey(), e ), e );
    if ( e.getStatus() == ApplicationStatus.NOT_FOUND.code() )
    {
      throw new FileNotFoundException( name );
    }
    else
    {
      throw new IOException( String.format( "Failed to retrieve: %s from: %s. Reason: %s", path, store.getKey(), e ), e );
    }
  }
}

代码示例来源:origin: org.commonjava.aprox/aprox-dot-maven-common

@Override
public InputStream getResourceContent( final ITransaction transaction, final String resourceUri )
  throws WebdavException
{
  final StoreURIMatcher matcher = new StoreURIMatcher( resourceUri );
  final Transfer item = getTransfer( matcher );
  if ( item == null )
  {
    throw new WebdavException( "Cannot read content: " + resourceUri );
  }
  final String path = item.getPath();
  final StoreKey key = LocationUtils.getKey( item );
  try
  {
    return item.openInputStream();
  }
  catch ( final IOException e )
  {
    logger.error( String.format( "Failed to open InputStream for: %s in store: %s. Reason: %s", path, key, e.getMessage() ), e );
    throw new WebdavException( "Failed to get content for: " + resourceUri );
  }
}

代码示例来源:origin: org.commonjava.indy/indy-dot-maven-common

@Override
public InputStream getResourceContent( final ITransaction transaction, final String resourceUri )
  throws WebdavException
{
  final StoreURIMatcher matcher = new StoreURIMatcher( resourceUri );
  final Transfer item = getTransfer( matcher );
  if ( item == null )
  {
    throw new WebdavException( "Cannot read content: " + resourceUri );
  }
  final String path = item.getPath();
  final StoreKey key = LocationUtils.getKey( item );
  try
  {
    return item.openInputStream();
  }
  catch ( final IOException e )
  {
    logger.error( String.format( "Failed to open InputStream for: %s in store: %s. Reason: %s", path, key, e.getMessage() ), e );
    throw new WebdavException( "Failed to get content for: " + resourceUri );
  }
}

代码示例来源:origin: org.commonjava.indy/indy-pkg-npm-common

stream = src.openInputStream();
String content = IOUtils.toString( stream );
logger.debug( "Adding in metadata content from: {}\n\n{}\n\n", src, content );

代码示例来源:origin: org.commonjava.indy/indy-core

try(InputStream stream = transfer.openInputStream( false, forcedEventMetadata ) )

代码示例来源:origin: org.commonjava.aprox/aprox-core

stream = src.openInputStream();
final ArchetypeCatalog catalog = reader.read( stream, false );

代码示例来源:origin: org.commonjava.aprox/aprox-promote-common

try
  stream = transfer.openInputStream( true );
  final String path = transfer.getPath();
  contentManager.store( targetStore, path, stream, TransferOperation.UPLOAD, new EventMetadata() );

相关文章