All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.download.maven.plugin.internal.cache.FileIndex Maven / Gradle / Ivy

Go to download

This is a plugin meant to help maven user to download different files on different protocol in part of maven build. For the first implementation, there will only be a goal that will help downloading a maven artifact from the command line. Future version of the plugin could include web download, ftp download, scp download and so on.

There is a newer version: 1.9.0
Show newest version
package com.googlecode.download.maven.plugin.internal.cache;

import java.net.URI;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Convenient map to search for the path where file is locally stored
 * by uri of the resource the file was downloaded from.
 * Implementations should not read/write file bodies using stored paths.
 *
 * @author Paul Polishchuk
 * @since 1.3.1
 */
interface FileIndex {

    /**
     * Adds given path to the index using uri parameter as a key.
     * @param uri index key
     * @param path index value
     */
    void put(URI uri, String path);

    /**
     * Gets stored value by the key.
     * @param uri index key
     * @return path by given uri key; {@literal null} if not found.
     */
    String get(URI uri);

    /**
     * The lock to be used when accessing the index.
     * @return The lock.
     */
    ReentrantLock getLock();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy