本文整理了Java中org.commonjava.maven.galley.model.Transfer.isDirectory()
方法的一些代码示例,展示了Transfer.isDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transfer.isDirectory()
方法的具体详情如下:
包路径:org.commonjava.maven.galley.model.Transfer
类名称:Transfer
方法名:isDirectory
暂无
代码示例来源:origin: org.commonjava.aprox/aprox-promote-common
@Override
public boolean isDirectory()
{
return delegate.isDirectory();
}
代码示例来源:origin: org.commonjava.maven.galley/galley-core
private boolean isEmptyFolder( Transfer childRef ) throws IOException
{
if ( childRef.isDirectory() )
{
String[] list = childRef.list();
if ( list == null || list.length == 0 )
{
return true;
}
}
return false;
}
代码示例来源:origin: org.commonjava.maven.galley/galley-transport-httpclient
if ( metaTxfr == null )
if ( target.isDirectory() )
代码示例来源:origin: org.commonjava.maven.galley/galley-transport-httpclient
if ( metaTxfr == null )
if ( target.isDirectory() )
代码示例来源:origin: org.commonjava.aprox/aprox-core
private void recurseAndDelete( final Transfer txfr )
{
try
{
final String[] list = txfr.list();
if ( list == null )
{
return;
}
for ( final String fname : list )
{
final Transfer child = txfr.getChild( fname );
if ( child.isDirectory() )
{
recurseAndDelete( child );
}
else
{
child.delete( true );
}
}
}
catch ( final IOException e )
{
logger.error( String.format( "Failed to list files for deletion under: %s. Reason: %s", txfr,
e.getMessage() ), e );
}
}
代码示例来源:origin: org.commonjava.aprox/aprox-core
public void onStoreDeletion( @Observes final AbstractStoreDeleteEvent event )
{
for ( final Map.Entry<ArtifactStore, Transfer> storeRoot : event.getStoreRoots()
.entrySet() )
{
final StoreKey key = storeRoot.getKey()
.getKey();
final Transfer dir = storeRoot.getValue();
if ( dir.exists() && dir.isDirectory() )
{
try
{
logger.info( "[STORE REMOVED; DELETE] {}", dir.getFullPath() );
dir.delete();
scheduleManager.cancelAll( new StoreKeyMatcher( key, ScheduleManager.CONTENT_JOB_TYPE ) );
}
catch ( final IOException e )
{
logger.error( String.format( "Failed to delete storage for deleted artifact store: %s (dir: %s). Error: %s",
key, dir, e.getMessage() ), e );
}
catch ( final AproxSchedulerException e )
{
logger.error( String.format( "Failed to cancel file expirations for deleted artifact store: {} (dir: {}). Error: {}",
key, dir, e.getMessage() ), e );
}
}
}
}
代码示例来源:origin: org.commonjava.maven.galley/galley-api
if ( !allowsSnapshots || !allowsReleases )
if ( !transfer.isDirectory() )
代码示例来源:origin: org.commonjava.indy/indy-core
if ( t.isDirectory() )
代码示例来源:origin: org.commonjava.indy/indy-core
private void recurseListing( final Transfer transfer, final List<Transfer> result )
throws IndyWorkflowException
{
if ( transfer.isDirectory() )
{
try
{
final String[] children = transfer.list();
for ( final String child : children )
{
final Transfer childTransfer = transfer.getChild( child );
recurseListing( childTransfer, result );
}
}
catch ( final IOException e )
{
throw new IndyWorkflowException( "Failed to list children of: %s. Reason: %s", e, transfer,
e.getMessage() );
}
}
else if ( transfer.exists() )
{
result.add( transfer );
}
}
代码示例来源:origin: org.commonjava.aprox/aprox-core
private void recurseListing( final Transfer transfer, final List<Transfer> result )
throws AproxWorkflowException
{
if ( transfer.isDirectory() )
{
try
{
final String[] children = transfer.list();
for ( final String child : children )
{
final Transfer childTransfer = transfer.getChild( child );
recurseListing( childTransfer, result );
}
}
catch ( final IOException e )
{
throw new AproxWorkflowException( "Failed to list children of: %s. Reason: %s", e, transfer,
e.getMessage() );
}
}
else if ( transfer.exists() )
{
result.add( transfer );
}
}
代码示例来源:origin: org.commonjava.indy/indy-core
private void doRescan( final Transfer item )
{
if ( !item.exists() )
{
return;
}
if ( item.isDirectory() )
{
try
{
final String[] listing = item.list();
for ( final String sub : listing )
{
doRescan( item.getChild( sub ) );
}
}
catch ( final IOException e )
{
logger.error( "Failed to list local contents: {}. Reason: {}", e, item, e.getMessage() );
}
}
fileEventManager.fire( new FileAccessEvent( item, eventMetadata ) );
}
代码示例来源:origin: org.commonjava.aprox/aprox-core
private void doRescan( final Transfer item )
{
if ( !item.exists() )
{
return;
}
if ( item.isDirectory() )
{
try
{
final String[] listing = item.list();
for ( final String sub : listing )
{
doRescan( item.getChild( sub ) );
}
}
catch ( final IOException e )
{
logger.error( "Failed to list local contents: {}. Reason: {}", e, item, e.getMessage() );
}
}
fileEventManager.fire( new FileAccessEvent( item, eventMetadata ) );
}
代码示例来源:origin: org.commonjava.aprox/aprox-promote-common
private void listRecursively( ArtifactStore store, String path, Set<String> paths )
throws AproxWorkflowException
{
List<StoreResource> listing = tools.list( store, path );
if ( listing != null )
{
for ( StoreResource res : listing )
{
if ( res != null )
{
Transfer txfr = tools.getTransfer( res );
if ( txfr != null )
{
if ( txfr.isDirectory() )
{
listRecursively( store, txfr.getPath(), paths );
}
else if ( txfr.exists() )
{
paths.add( txfr.getPath() );
}
}
}
}
}
}
代码示例来源:origin: org.commonjava.indy/indy-bindings-jaxrs
else if ( item.isDirectory() )
代码示例来源:origin: org.commonjava.aprox/aprox-bindings-jaxrs
else if ( item.isDirectory() || ( path.endsWith( "index.html" ) ) )
代码示例来源:origin: org.commonjava.maven.galley/galley-core
public void decorateDelete( final Transfer transfer, final EventMetadata eventMetadata )
throws IOException
{
if ( transfer.isDirectory() )
{
return;
}
SpecialPathInfo specialPathInfo = specialPathManager.getSpecialPathInfo( transfer, eventMetadata.getPackageType() );
if ( specialPathInfo == null || specialPathInfo.isDeletable() )
{
for ( final AbstractChecksumGeneratorFactory<?> factory : checksumFactories )
{
final AbstractChecksumGenerator generator = factory.createGenerator( transfer );
generator.delete();
}
}
if ( consumer != null )
{
consumer.removeMetadata( transfer );
}
}
}
代码示例来源:origin: org.commonjava.indy/indy-dot-maven-common
if ( !item.isDirectory() )
if ( !item.exists() || !item.isDirectory() )
代码示例来源:origin: org.commonjava.maven.galley/galley-core
if ( item.isDirectory() )
代码示例来源:origin: org.commonjava.indy/indy-dot-maven-common
@Override
public StoredObject getStoredObject( final ITransaction transaction, final String uri )
throws WebdavException
{
final StoredObject so = new StoredObject();
final StoreURIMatcher matcher = new StoreURIMatcher( uri );
if ( matcher.hasStorePath() )
{
final Transfer item = getTransfer( matcher );
if ( item == null )
{
return null;
}
so.setCreationDate( new Date( item.lastModified() ) );
so.setLastModified( new Date( item.lastModified() ) );
so.setFolder( item.isDirectory() );
so.setResourceLength( item.length() );
}
else
{
final Date d = new Date();
so.setCreationDate( d );
so.setLastModified( d );
so.setFolder( true );
}
return so;
}
代码示例来源:origin: org.commonjava.aprox/aprox-dot-maven-common
@Override
public StoredObject getStoredObject( final ITransaction transaction, final String uri )
throws WebdavException
{
final StoredObject so = new StoredObject();
final StoreURIMatcher matcher = new StoreURIMatcher( uri );
if ( matcher.hasStorePath() )
{
final Transfer item = getTransfer( matcher );
if ( item == null )
{
return null;
}
so.setCreationDate( new Date( item.lastModified() ) );
so.setLastModified( new Date( item.lastModified() ) );
so.setFolder( item.isDirectory() );
so.setResourceLength( item.length() );
}
else
{
final Date d = new Date();
so.setCreationDate( d );
so.setLastModified( d );
so.setFolder( true );
}
return so;
}
内容来源于网络,如有侵权,请联系作者删除!