Package org.apache.ivy.util

Examples of org.apache.ivy.util.PropertiesFile


            String resolvedRevision = null;
            if (options.isForce()) {
                Message.verbose("refresh mode: no check for cached resolved revision for " + mrid);
                return null;
            }
            PropertiesFile cachedResolvedRevision = getCachedDataFile(mrid);
            String expiration = cachedResolvedRevision.getProperty("expiration.time");
            if (expiration == null) {
                Message.verbose("no cached resolved revision for " + mrid);
                return null;
            }
            if (System.currentTimeMillis() > Long.parseLong(expiration)) {
                Message.verbose("cached resolved revision expired for " + mrid);
                return null;
            }
            resolvedRevision = cachedResolvedRevision.getProperty("resolved.revision");
            if (resolvedRevision == null) {
                Message.verbose("no cached resolved revision value for " + mrid);
                return null;
            }
            return resolvedRevision;
View Full Code Here


        if (!lockMetadataArtifact(mrid)) {
            Message.error("impossible to acquire lock for " + mrid);
            return;
        }
        try {
            PropertiesFile cachedResolvedRevision = getCachedDataFile(mrid);
            cachedResolvedRevision.setProperty("expiration.time", getExpiration(mrid));
            cachedResolvedRevision.setProperty("resolved.revision", revision);
            cachedResolvedRevision.save();
        } finally {
            unlockMetadataArtifact(mrid);
        }
    }
View Full Code Here

     *            the module descriptor resolved
     * @param name
     *            resolver name
     */
    public void saveResolver(ModuleDescriptor md, String name) {
        PropertiesFile cdf = getCachedDataFile(md);
        cdf.setProperty("resolver", name);
        cdf.save();
    }
View Full Code Here

     *            the module descriptor resolved
     * @param name
     *            artifact resolver name
     */
    public void saveArtResolver(ModuleDescriptor md, String name) {
        PropertiesFile cdf = getCachedDataFile(md);
        cdf.setProperty("artifact.resolver", name);
        cdf.save();
    }
View Full Code Here

        cdf.setProperty("artifact.resolver", name);
        cdf.save();
    }

    public void saveArtifactOrigin(Artifact artifact, ArtifactOrigin origin) {
        PropertiesFile cdf = getCachedDataFile(artifact.getModuleRevisionId());
        cdf.setProperty(getIsLocalKey(artifact), String.valueOf(origin.isLocal()));
        cdf.setProperty(getLocationKey(artifact), origin.getLocation());
        cdf.save();
    }
View Full Code Here

        cdf.setProperty(getLocationKey(artifact), origin.getLocation());
        cdf.save();
    }

    public ArtifactOrigin getSavedArtifactOrigin(Artifact artifact) {
        PropertiesFile cdf = getCachedDataFile(artifact.getModuleRevisionId());
        String location = cdf.getProperty(getLocationKey(artifact));
        String local = cdf.getProperty(getIsLocalKey(artifact));
        boolean isLocal = Boolean.valueOf(local).booleanValue();

        if (location == null) {
            // origin has not been specified, return null
            return null;
View Full Code Here

        return new ArtifactOrigin(isLocal, location);
    }

    public void removeSavedArtifactOrigin(Artifact artifact) {
        PropertiesFile cdf = getCachedDataFile(artifact.getModuleRevisionId());
        cdf.remove(getLocationKey(artifact));
        cdf.remove(getIsLocalKey(artifact));
        cdf.save();
    }
View Full Code Here

        String prefix = getPrefixKey(artifact);
        return prefix + ".is-local";
    }

    private String getSavedResolverName(ModuleDescriptor md) {
        PropertiesFile cdf = getCachedDataFile(md);
        return cdf.getProperty("resolver");
    }
View Full Code Here

        PropertiesFile cdf = getCachedDataFile(md);
        return cdf.getProperty("resolver");
    }

    private String getSavedArtResolverName(ModuleDescriptor md) {
        PropertiesFile cdf = getCachedDataFile(md);
        return cdf.getProperty("artifact.resolver");
    }
View Full Code Here

    private PropertiesFile getCachedDataFile(ModuleDescriptor md) {
        return getCachedDataFile(md.getResolvedModuleRevisionId());
    }

    private PropertiesFile getCachedDataFile(ModuleRevisionId mRevId) {
        return new PropertiesFile(new File(cache, IvyPatternHelper.substitute(settings
                .getCacheDataFilePattern(), mRevId)), "ivy cached data file for " + mRevId);
    }
View Full Code Here

TOP

Related Classes of org.apache.ivy.util.PropertiesFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.