本文整理了Java中org.commonjava.maven.galley.model.Transfer.getLocation()
方法的一些代码示例,展示了Transfer.getLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transfer.getLocation()
方法的具体详情如下:
包路径:org.commonjava.maven.galley.model.Transfer
类名称:Transfer
方法名:getLocation
暂无
代码示例来源:origin: org.commonjava.aprox/aprox-promote-common
@Override
public Location getLocation()
{
return delegate.getLocation();
}
代码示例来源:origin: org.commonjava.maven.galley/galley-transport-filearc
protected AbstractZipOperation( final Transfer transfer )
{
this( transfer.getLocation(), transfer.getPath() );
this.transfer = transfer;
}
代码示例来源:origin: org.commonjava.indy/indy-api
public static StoreKey getKey( final Transfer transfer )
{
if ( transfer == null )
{
return null;
}
final Location loc = transfer.getLocation();
if ( loc instanceof KeyedLocation )
{
return ( (KeyedLocation) loc ).getKey();
}
return null;
}
代码示例来源:origin: org.commonjava.maven.galley/galley-transport-httpclient
@Override
public OverriddenBooleanValue decorateExists( final Transfer transfer, final EventMetadata metadata )
{
final Location loc = transfer.getLocation();
final boolean isHttp = loc instanceof HttpLocation;
final boolean filtered = TransferUtils.filterTransfer( transfer );
if ( isHttp && filtered )
{
return OverriddenBooleanValue.OVERRIDE_FALSE;
}
return OverriddenBooleanValue.DEFER;
}
代码示例来源:origin: org.commonjava.maven.galley/galley-api
public TransferTimeoutException( final Transfer target, final String format, final Object... params )
{
super( target.getLocation(), format, params );
this.url = composeUrl( target.getResource() );
}
代码示例来源:origin: org.commonjava.maven.galley/galley-api
public TransferTimeoutException( final Transfer target, final String format, final Throwable error, final Object... params )
{
super( target.getLocation(), format, error, params );
this.url = composeUrl( target.getResource() );
}
代码示例来源:origin: org.commonjava.indy/indy-core
private String generateCacheKey( final Transfer transfer )
{
KeyedLocation kl = (KeyedLocation) transfer.getLocation();
return kl.getKey() + "#" + transfer.getPath();
}
代码示例来源:origin: org.commonjava.maven.galley/galley-core
@Override
public SpecialPathInfo getSpecialPathInfo( Transfer transfer, String pkgType )
{
if ( transfer != null )
{
return getSpecialPathInfo( transfer.getLocation(), transfer.getPath(), pkgType );
}
// TODO: Return SpecialPathConstants.DEFAULT_FILE or SpecialPathConstants.DEFAULT_DIR or something non-null?
return null;
}
代码示例来源:origin: org.commonjava.maven.galley/galley-core
@Override
public void close() throws IOException
{
try
{
logger.trace( "START CLOSE: {}", transfer );
super.close();
logger.trace( "Delete: {} and its siblings in: {}.", transfer.getPath(), transfer.getLocation() );
transfer.delete( false );
Transfer meta = transfer.getSibling( HTTP_METADATA_EXT );
if ( meta != null && meta.exists() )
{
meta.delete( false );
}
}
finally
{
logger.trace( "END CLOSE: {}", transfer );
}
}
}
代码示例来源:origin: org.commonjava.maven.galley/galley-transport-httpclient
@Override
public OutputStream decorateWrite( final OutputStream stream, final Transfer transfer, final TransferOperation op, final EventMetadata metadata )
throws IOException
{
final Location loc = transfer.getLocation();
final boolean allowsSnapshots = loc.allowsSnapshots();
final boolean allowsReleases = loc.allowsReleases();
if ( loc instanceof HttpLocation && ( !allowsSnapshots || !allowsReleases )
&& transfer.getFullPath().endsWith( "maven-metadata.xml" ) )
{
return new MetadataFilteringOutputStream( stream, allowsSnapshots, allowsReleases, transfer );
}
else
{
return stream;
}
}
代码示例来源:origin: org.commonjava.maven.galley/galley-core
logger.trace( "Read done: {} in: {}. Now, creating checksums.", transfer.getPath(), transfer.getLocation() );
Map<ContentDigest, String> hexDigests = new HashMap<>();
for ( final AbstractChecksumGenerator checksum : checksums )
代码示例来源:origin: org.commonjava.maven.galley/galley-api
public Transfer getSiblingMeta( final String extension )
{
if ( resource.isRoot() )
{
return null;
}
final String named = resource.getPath() + extension;
final Transfer tx = this;
logger.debug( "Creating meta-transfer sibling for: {}", new Object()
{
@Override
public String toString()
{
return tx + " with name: " + named + " (parent: " + tx.getParent() + ")";
}
} );
return provider.getTransfer( new ConcreteResource( getLocation(), named ) );
}
代码示例来源:origin: org.commonjava.maven.galley/galley-api
final Location loc = transfer.getLocation();
final boolean allowsSnapshots = loc.allowsSnapshots();
final boolean allowsReleases = loc.allowsReleases();
代码示例来源:origin: org.commonjava.aprox/aprox-promote-common
public MavenPomView readPom( String path, PromoteRequest request, StoreKey... extraLocations )
throws AproxWorkflowException, GalleyMavenException, AproxDataException
{
ArtifactRef artifactRef = getArtifact( path );
if ( artifactRef == null )
{
return null;
}
StoreKey key = request.getSource();
Transfer transfer = getTransfer( key, path );
List<Location> locations = new ArrayList<>( extraLocations.length + 1 );
locations.add( transfer.getLocation() );
addLocations( locations, extraLocations );
return pomReader.read( artifactRef.asProjectVersionRef(), transfer, locations, MavenPomView.ALL_PROFILES );
}
代码示例来源:origin: org.commonjava.maven.galley/galley-core
logger.trace( "Wrote: {} (size: {}) in: {}. Now, writing checksums.", transfer.getPath(), size, transfer.getLocation() );
Map<ContentDigest, String> hexDigests = new HashMap<>();
for ( final AbstractChecksumGenerator checksum : checksums )
代码示例来源:origin: org.commonjava.aprox/aprox-core
@Override
public Transfer store( final List<? extends ArtifactStore> stores, final String path, final InputStream stream,
final TransferOperation op, final EventMetadata eventMetadata )
throws AproxWorkflowException
{
logger.info( "Storing: {} in: {} with event metadata: {}", path, stores, eventMetadata );
final Transfer txfr = downloadManager.store( stores, path, stream, op, eventMetadata );
if ( txfr != null )
{
final KeyedLocation kl = (KeyedLocation) txfr.getLocation();
ArtifactStore transferStore;
try
{
transferStore = storeManager.getArtifactStore( kl.getKey() );
}
catch ( final AproxDataException e )
{
throw new AproxWorkflowException( "Failed to lookup store: %s. Reason: %s", e, kl.getKey(),
e.getMessage() );
}
for ( final ContentGenerator generator : contentGenerators )
{
logger.info( "{} Handling content storage of: {} in: {}", generator, path, transferStore.getKey() );
generator.handleContentStorage( transferStore, path, txfr, eventMetadata );
}
}
return txfr;
}
代码示例来源:origin: org.commonjava.indy/indy-core
@Override
public Transfer store( final List<? extends ArtifactStore> stores, final StoreKey topKey, final String path, final InputStream stream,
final TransferOperation op, final EventMetadata eventMetadata )
throws IndyWorkflowException
{
logger.debug( "Storing: {} in: {} with event metadata: {}", path, stores, eventMetadata );
final Transfer txfr = downloadManager.store( stores, path, stream, op, eventMetadata );
if ( txfr != null )
{
final KeyedLocation kl = (KeyedLocation) txfr.getLocation();
ArtifactStore transferStore;
try
{
transferStore = storeManager.getArtifactStore( kl.getKey() );
}
catch ( final IndyDataException e )
{
throw new IndyWorkflowException( "Failed to lookup store: %s. Reason: %s", e, kl.getKey(),
e.getMessage() );
}
for ( final ContentGenerator generator : contentGenerators )
{
logger.debug( "{} Handling content storage of: {} in: {}", generator, path, transferStore.getKey() );
generator.handleContentStorage( transferStore, path, txfr, eventMetadata );
}
clearNFCEntries(kl, path);
}
return txfr;
}
代码示例来源:origin: org.commonjava.aprox/aprox-promote-common
public Set<ProjectRelationship<?, ?>> getRelationshipsForPom( String path, DiscoveryConfig dc, PromoteRequest request,
StoreKey... extraLocations )
throws AproxWorkflowException, GalleyMavenException, CartoDataException, AproxDataException
{
ArtifactRef artifactRef = getArtifact( path );
if ( artifactRef == null )
{
return null;
}
StoreKey key = request.getSource();
Transfer transfer = getTransfer( key, path );
List<Location> locations = new ArrayList<>( extraLocations.length + 1 );
locations.add( transfer.getLocation() );
addLocations( locations, extraLocations );
MavenPomView pomView =
pomReader.read( artifactRef.asProjectVersionRef(), transfer, locations, MavenPomView.ALL_PROFILES );
URI source = sourceManager.createSourceURI( key.toString() );
DiscoveryResult discoveryResult = modelProcessor.readRelationships( pomView, source, dc );
discoveryResult =
patcherSupport.patch( discoveryResult, DepgraphPatcherConstants.ALL_PATCHERS, locations, pomView,
transfer );
return discoveryResult.getAcceptedRelationships();
}
代码示例来源:origin: org.commonjava.aprox/aprox-core
if ( txfr != null )
final KeyedLocation kl = (KeyedLocation) txfr.getLocation();
ArtifactStore transferStore;
try
代码示例来源:origin: org.commonjava.indy/indy-core
if ( txfr != null )
final KeyedLocation kl = (KeyedLocation) txfr.getLocation();
ArtifactStore transferStore;
try
内容来源于网络,如有侵权,请联系作者删除!