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

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

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

Transfer.createFile介绍

暂无

代码示例

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

@Override
public void createResource( final ITransaction transaction, final String resourceUri )
  throws WebdavException
{
  final StoreURIMatcher matcher = new StoreURIMatcher( resourceUri );
  if ( !matcher.hasStorePath() )
  {
    throw new WebdavException( "No store-level path specified: '" + resourceUri
      + "'. This URI references either a list of stores, a root store directory, or something else equally read-only." );
  }
  final StorageAdvice advice = getStorageAdviceFor( matcher );
  final String path = matcher.getStorePath();
  final Transfer item = fileManager.getStorageReference( advice.getHostedStore(), path );
  try
  {
    item.createFile();
  }
  catch ( final IOException e )
  {
    logger.error( "Failed to create file: {} in store: {}. Reason: {}", e, path, advice.getStore()
                                              .getKey(), e.getMessage() );
    throw new WebdavException( "Failed to create file: " + resourceUri );
  }
}

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

@Override
public void createResource( final ITransaction transaction, final String resourceUri )
  throws WebdavException
{
  final StoreURIMatcher matcher = new StoreURIMatcher( resourceUri );
  if ( !matcher.hasStorePath() )
  {
    throw new WebdavException( "No store-level path specified: '" + resourceUri
      + "'. This URI references either a list of stores, a root store directory, or something else equally read-only." );
  }
  final StorageAdvice advice = getStorageAdviceFor( matcher );
  final String path = matcher.getStorePath();
  final Transfer item = fileManager.getStorageReference( advice.getHostedStore(), path );
  try
  {
    item.createFile();
  }
  catch ( final IOException e )
  {
    logger.error( "Failed to create file: {} in store: {}. Reason: {}", e, path, advice.getStore()
                                              .getKey(), e.getMessage() );
    throw new WebdavException( "Failed to create file: " + resourceUri );
  }
}

相关文章