本文整理了Java中org.commonjava.maven.galley.model.Transfer.createFile()
方法的一些代码示例,展示了Transfer.createFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transfer.createFile()
方法的具体详情如下:
包路径:org.commonjava.maven.galley.model.Transfer
类名称: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 );
}
}
内容来源于网络,如有侵权,请联系作者删除!