org.apache.ivy.core.cache.ModuleDescriptorWriter Java Examples

The following examples show how to use org.apache.ivy.core.cache.ModuleDescriptorWriter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BasicResolver.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
private void cacheModuleDescriptor(ModuleDescriptor systemMd, ModuleRevisionId systemMrid,
        ResolvedResource ivyRef, ResolvedModuleRevision rmr) {
    RepositoryCacheManager cacheManager = getRepositoryCacheManager();

    final ModuleDescriptorParser parser = systemMd.getParser();

    // the metadata artifact which was used to cache the original metadata file
    Artifact requestedMetadataArtifact = (ivyRef == null) ? systemMd.getMetadataArtifact()
            : parser.getMetadataArtifact(
                    ModuleRevisionId.newInstance(systemMrid, systemMd.getRevision()),
            ivyRef.getResource());

    cacheManager.originalToCachedModuleDescriptor(this, ivyRef, requestedMetadataArtifact, rmr,
        new ModuleDescriptorWriter() {
            public void write(ResolvedResource originalMdResource, ModuleDescriptor md,
                    File src, File dest) throws IOException, ParseException {
                if (originalMdResource == null) {
                    // a basic ivy file is written containing default data
                    XmlModuleDescriptorWriter.write(md, dest);
                } else {
                    // copy and update ivy file from source to cache
                    parser.toIvyFile(new FileInputStream(src),
                        originalMdResource.getResource(), dest, md);
                    long repLastModified = originalMdResource.getLastModified();
                    if (repLastModified > 0) {
                        dest.setLastModified(repLastModified);
                    }
                }
            }
        });
}
 
Example #2
Source File: AbstractRepositoryCacheManager.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void originalToCachedModuleDescriptor(DependencyResolver resolver, ResolvedResource originalMetadataRef, Artifact requestedMetadataArtifact, ResolvedModuleRevision rmr, ModuleDescriptorWriter writer) {
}
 
Example #3
Source File: AbstractRepositoryCacheManager.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void originalToCachedModuleDescriptor(DependencyResolver resolver, ResolvedResource originalMetadataRef, Artifact requestedMetadataArtifact, ResolvedModuleRevision rmr, ModuleDescriptorWriter writer) {
}