Package org.apache.ivy.util

Examples of org.apache.ivy.util.PropertiesFile


     * by getSavedResolverName(ModuleDescriptor md)
     * @param md 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


     * by getSavedArtResolverName(ModuleDescriptor md)
     * @param md 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("artifact." + artifact.getName() + "#" + artifact.getExt() + ".is-local", String.valueOf(origin.isLocal()));
       cdf.setProperty("artifact." + artifact.getName() + "#" + artifact.getExt() + ".location", origin.getLocation());
       cdf.save();
    }
View Full Code Here

       cdf.setProperty("artifact." + artifact.getName() + "#" + artifact.getExt() + ".location", origin.getLocation());
       cdf.save();
    }
   
    public ArtifactOrigin getSavedArtifactOrigin(Artifact artifact) {
        PropertiesFile cdf = getCachedDataFile(artifact.getModuleRevisionId());
        String location = cdf.getProperty("artifact." + artifact.getName() + "#" + artifact.getExt() + ".location");
        boolean isLocal = Boolean.valueOf(cdf.getProperty("artifact." + artifact.getName() + "#" + artifact.getExt() + ".is-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("artifact." + artifact.getName() + "#" + artifact.getExt() + ".location");
        cdf.remove("artifact." + artifact.getName() + "#" + artifact.getExt() + ".is-local");
        cdf.save();
    }
View Full Code Here

        cdf.remove("artifact." + artifact.getName() + "#" + artifact.getExt() + ".is-local");
        cdf.save();
    }
   
    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

     * @param name
     *            resolver name
     */
    private void saveResolver(ModuleDescriptor md, String name) {
        // should always be called with a lock on module metadata artifact
        PropertiesFile cdf = getCachedDataFile(md);
        cdf.setProperty("resolver", name);
        cdf.save();
    }
View Full Code Here

        if (!lockMetadataArtifact(mrid)) {
            Message.error("impossible to acquire lock for " + mrid);
            return;
        }
        try {
            PropertiesFile cdf = getCachedDataFile(md);
            cdf.setProperty("resolver", metadataResolverName);
            cdf.setProperty("artifact.resolver", artifactResolverName);
            cdf.save();
        } finally {
            unlockMetadataArtifact(mrid);
        }
    }
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.