Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(final String string) {
+		super(string);
+	}
+
+	public DownloadServiceException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(final Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/pom.xml	(revision 45176)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.2.1</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,55 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+    /**
+     * If Sets the base path, the plugin will start to download from the basePath in the file system
+     *
+     * @param basePath the base path
+     * @return the string
+     */
+    void setBasePath(String basePath);
+
+    /**
+     * This method retrieve the correct Url of the file from the starting URL
+     *
+     * @param url the starting url
+     * @return the Url of the correct file
+     */
+    DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
+
+    /**
+     * This method retrieve the correct Url of the file from a list of starting URL
+     *
+     * @param urls the list of starting url
+     * @return the list of the file URL
+     */
+    Iterable<DownloadItem> retrieveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
+
+    /**
+     * Get the name of the plugin
+     *
+     * @return the name of the plugin
+     */
+    String getPluginName();
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    List<String> getRegularExpression();
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+public class DownloadPluginException extends RuntimeException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -8480343562060711656L;
+
+	public DownloadPluginException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadPluginException(final Throwable exception) {
+		super(exception);
+	}
+
+	public DownloadPluginException(final String msg) {
+		super(msg);
+
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(final String string) {
+		super(string);
+	}
+
+	public DownloadServiceException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(final Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/trunk/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/trunk/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/pom.xml	(revision 45176)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.3.3-SNAPSHOT</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.9</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,59 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+	/**
+	 * If Sets the base path, the plugin will start to download from the basePath in the file system
+	 *
+	 * @param basePath
+	 *            the base path
+	 * @return the string
+	 */
+	void setBasePath(String basePath);
+
+	/**
+	 * This method retrieve the correct Url of the file from the starting URL
+	 *
+	 * @param url
+	 *            the starting url
+	 * @return the Url of the correct file
+	 */
+	DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
+
+	/**
+	 * This method retrieve the correct Url of the file from a list of starting URL
+	 *
+	 * @param urls
+	 *            the list of starting url
+	 * @return the list of the file URL
+	 */
+	Iterable<DownloadItem> retireveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
+
+	/**
+	 * Get the name of the plugin
+	 *
+	 * @return the name of the plugin
+	 */
+	String getPluginName();
+
+	/**
+	 * Gets the regular expression.
+	 *
+	 * @return the regular expression
+	 */
+	List<String> getRegularExpression();
+
+	/**
+	 * Sets the regular expression.
+	 *
+	 * @param regularExpression
+	 *            the new regular expression
+	 */
+	void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,180 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+	/**
+	 * The url.
+	 */
+	private String url;
+	/** The file name. */
+	private String fileName;
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+	/** The open access. */
+	private OpenAccessValues openAccess;
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (url == null) return url;
+		return url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		this.url = url;
+
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return originalUrl;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		this.originalUrl = originalUrl;
+
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(revision 45176)
@@ -0,0 +1,103 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import com.google.gson.Gson;
+import eu.dnetlib.data.download.rmi.DownloadItem.OpenAccessValues;
+import org.joda.time.DateTime;
+import org.joda.time.Days;
+
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class AbstractDownloadPlugin.
+ */
+public abstract class AbstractDownloadPlugin {
+
+	public static final int DEFAULT_TIMEOUT = 5000;
+
+    /**
+     * The regular expression.
+     */
+    protected List<String> regularExpression;
+
+
+    /**
+     * Check open access.
+     *
+     * @param input the input
+     * @return the download item
+     */
+    public DownloadItem checkOpenAccess(final DownloadItem input) {
+        if (input != null) {
+            OpenAccessValues openAccess = OpenAccessValues.valueOf(input.getOpenAccess());
+            switch (openAccess) {
+                case OPEN:
+                    return input;
+                case CLOSED:
+                case RESTRICTED:
+                case UNKNOWN:
+                    return null;
+                case EMBARGO:
+                    if (input.getEmbargoDate() == null) return null;
+                    DateTime embargoDate = new DateTime(input.getEmbargoDate());
+                    DateTime today = new DateTime();
+                    Days days = Days.daysBetween(embargoDate, today);
+                    if (days.getDays() <= 0) return input;
+                    return null;
+            }
+        }
+        return null;
+    }
+
+
+    public DownloadItem filterByRegexp(final DownloadItem input) {
+        if (this.regularExpression != null && this.regularExpression.size() > 0) {
+            final String baseURLs = input.getUrl();
+            final List<String> urlsList = new Gson().fromJson(baseURLs, List.class);
+
+            for (final String baseURL : urlsList) {
+                for (final String regExp : regularExpression) {
+                    if (baseURL.matches(regExp))
+                        return input;
+                }
+            }
+            return null;
+        } else return input;
+    }
+
+    protected boolean checkUrlsNotNull(DownloadItem input, List<String> urls) {
+        for (String s : urls) {
+            String newURL = extractURL(s);
+            if (newURL != null) {
+                input.setOriginalUrl(s);
+                input.setUrl(newURL);
+                return true;
+            }
+        }
+        return false;
+    }
+
+	public abstract String extractURL(final String baseURL) throws DownloadPluginException;
+
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    public List<String> getRegularExpression() {
+        return regularExpression;
+    }
+
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    public void setRegularExpression(final List<String> regularExpression) {
+        this.regularExpression = regularExpression;
+    }
+
+}
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,55 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+    /**
+     * If Sets the base path, the plugin will start to download from the basePath in the file system
+     *
+     * @param basePath the base path
+     * @return the string
+     */
+    void setBasePath(String basePath);
+
+    /**
+     * This method retrieve the correct Url of the file from the starting URL
+     *
+     * @param url the starting url
+     * @return the Url of the correct file
+     */
+    DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
+
+    /**
+     * This method retrieve the correct Url of the file from a list of starting URL
+     *
+     * @param urls the list of starting url
+     * @return the list of the file URL
+     */
+    Iterable<DownloadItem> retrieveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
+
+    /**
+     * Get the name of the plugin
+     *
+     * @return the name of the plugin
+     */
+    String getPluginName();
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    List<String> getRegularExpression();
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+public class DownloadPluginException extends RuntimeException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -8480343562060711656L;
+
+	public DownloadPluginException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadPluginException(final Throwable exception) {
+		super(exception);
+	}
+
+	public DownloadPluginException(final String msg) {
+		super(msg);
+
+	}
+
+}
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(final String string) {
+		super(string);
+	}
+
+	public DownloadServiceException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(final Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+public class DownloadPluginException extends DownloadServiceException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -8480343562060711656L;
+
+	public DownloadPluginException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadPluginException(final Throwable exception) {
+		super(exception);
+	}
+
+	public DownloadPluginException(final String msg) {
+		super(msg);
+
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(final String string) {
+		super(string);
+	}
+
+	public DownloadServiceException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(final Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/trunk/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/trunk/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/trunk/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/trunk/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/trunk
===================================================================
--- modules/dnet-download-service-rmi/trunk	(nonexistent)
+++ modules/dnet-download-service-rmi/trunk	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/trunk
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,8 ##
+*.iml
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/pom.xml	(revision 45176)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.1.1</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/pom.xml	(revision 45176)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.3.2</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.9</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,180 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+	/**
+	 * The url.
+	 */
+	private String url;
+	/** The file name. */
+	private String fileName;
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+	/** The open access. */
+	private OpenAccessValues openAccess;
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (url == null) return url;
+		return url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		this.url = url;
+
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return originalUrl;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		this.originalUrl = originalUrl;
+
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(revision 45176)
@@ -0,0 +1,103 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import com.google.gson.Gson;
+import eu.dnetlib.data.download.rmi.DownloadItem.OpenAccessValues;
+import org.joda.time.DateTime;
+import org.joda.time.Days;
+
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class AbstractDownloadPlugin.
+ */
+public abstract class AbstractDownloadPlugin {
+
+	public static final int DEFAULT_TIMEOUT = 5000;
+
+    /**
+     * The regular expression.
+     */
+    protected List<String> regularExpression;
+
+
+    /**
+     * Check open access.
+     *
+     * @param input the input
+     * @return the download item
+     */
+    public DownloadItem checkOpenAccess(final DownloadItem input) {
+        if (input != null) {
+            OpenAccessValues openAccess = OpenAccessValues.valueOf(input.getOpenAccess());
+            switch (openAccess) {
+                case OPEN:
+                    return input;
+                case CLOSED:
+                case RESTRICTED:
+                case UNKNOWN:
+                    return null;
+                case EMBARGO:
+                    if (input.getEmbargoDate() == null) return null;
+                    DateTime embargoDate = new DateTime(input.getEmbargoDate());
+                    DateTime today = new DateTime();
+                    Days days = Days.daysBetween(embargoDate, today);
+                    if (days.getDays() <= 0) return input;
+                    return null;
+            }
+        }
+        return null;
+    }
+
+
+    public DownloadItem filterByRegexp(final DownloadItem input) {
+        if (this.regularExpression != null && this.regularExpression.size() > 0) {
+            final String baseURLs = input.getUrl();
+            final List<String> urlsList = new Gson().fromJson(baseURLs, List.class);
+
+            for (final String baseURL : urlsList) {
+                for (final String regExp : regularExpression) {
+                    if (baseURL.matches(regExp))
+                        return input;
+                }
+            }
+            return null;
+        } else return input;
+    }
+
+    protected boolean checkUrlsNotNull(DownloadItem input, List<String> urls) {
+        for (String s : urls) {
+            String newURL = extractURL(s);
+            if (newURL != null) {
+                input.setOriginalUrl(s);
+                input.setUrl(newURL);
+                return true;
+            }
+        }
+        return false;
+    }
+
+	public abstract String extractURL(final String baseURL) throws DownloadPluginException;
+
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    public List<String> getRegularExpression() {
+        return regularExpression;
+    }
+
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    public void setRegularExpression(final List<String> regularExpression) {
+        this.regularExpression = regularExpression;
+    }
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,55 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+    /**
+     * If Sets the base path, the plugin will start to download from the basePath in the file system
+     *
+     * @param basePath the base path
+     * @return the string
+     */
+    void setBasePath(String basePath);
+
+    /**
+     * This method retrieve the correct Url of the file from the starting URL
+     *
+     * @param url the starting url
+     * @return the Url of the correct file
+     */
+    DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
+
+    /**
+     * This method retrieve the correct Url of the file from a list of starting URL
+     *
+     * @param urls the list of starting url
+     * @return the list of the file URL
+     */
+    Iterable<DownloadItem> retrieveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
+
+    /**
+     * Get the name of the plugin
+     *
+     * @return the name of the plugin
+     */
+    String getPluginName();
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    List<String> getRegularExpression();
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+public class DownloadPluginException extends RuntimeException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -8480343562060711656L;
+
+	public DownloadPluginException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadPluginException(final Throwable exception) {
+		super(exception);
+	}
+
+	public DownloadPluginException(final String msg) {
+		super(msg);
+
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(final String string) {
+		super(string);
+	}
+
+	public DownloadServiceException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(final Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,59 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+	/**
+	 * If Sets the base path, the plugin will start to download from the basePath in the file system
+	 *
+	 * @param basePath
+	 *            the base path
+	 * @return the string
+	 */
+	void setBasePath(String basePath);
+
+	/**
+	 * This method retrieve the correct Url of the file from the starting URL
+	 *
+	 * @param url
+	 *            the starting url
+	 * @return the Url of the correct file
+	 */
+	DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
+
+	/**
+	 * This method retrieve the correct Url of the file from a list of starting URL
+	 *
+	 * @param urls
+	 *            the list of starting url
+	 * @return the list of the file URL
+	 */
+	Iterable<DownloadItem> retireveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
+
+	/**
+	 * Get the name of the plugin
+	 *
+	 * @return the name of the plugin
+	 */
+	String getPluginName();
+
+	/**
+	 * Gets the regular expression.
+	 *
+	 * @return the regular expression
+	 */
+	List<String> getRegularExpression();
+
+	/**
+	 * Sets the regular expression.
+	 *
+	 * @param regularExpression
+	 *            the new regular expression
+	 */
+	void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.2
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,8 ##
+*.iml
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/pom.xml	(revision 45176)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.3.1</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.9</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(revision 45176)
@@ -0,0 +1,103 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import com.google.gson.Gson;
+import eu.dnetlib.data.download.rmi.DownloadItem.OpenAccessValues;
+import org.joda.time.DateTime;
+import org.joda.time.Days;
+
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class AbstractDownloadPlugin.
+ */
+public abstract class AbstractDownloadPlugin {
+
+	public static final int DEFAULT_TIMEOUT = 5000;
+
+    /**
+     * The regular expression.
+     */
+    protected List<String> regularExpression;
+
+
+    /**
+     * Check open access.
+     *
+     * @param input the input
+     * @return the download item
+     */
+    public DownloadItem checkOpenAccess(final DownloadItem input) {
+        if (input != null) {
+            OpenAccessValues openAccess = OpenAccessValues.valueOf(input.getOpenAccess());
+            switch (openAccess) {
+                case OPEN:
+                    return input;
+                case CLOSED:
+                case RESTRICTED:
+                case UNKNOWN:
+                    return null;
+                case EMBARGO:
+                    if (input.getEmbargoDate() == null) return null;
+                    DateTime embargoDate = new DateTime(input.getEmbargoDate());
+                    DateTime today = new DateTime();
+                    Days days = Days.daysBetween(embargoDate, today);
+                    if (days.getDays() <= 0) return input;
+                    return null;
+            }
+        }
+        return null;
+    }
+
+
+    public DownloadItem filterByRegexp(final DownloadItem input) {
+        if (this.regularExpression != null && this.regularExpression.size() > 0) {
+            final String baseURLs = input.getUrl();
+            final List<String> urlsList = new Gson().fromJson(baseURLs, List.class);
+
+            for (final String baseURL : urlsList) {
+                for (final String regExp : regularExpression) {
+                    if (baseURL.matches(regExp))
+                        return input;
+                }
+            }
+            return null;
+        } else return input;
+    }
+
+    protected boolean checkUrlsNotNull(DownloadItem input, List<String> urls) {
+        for (String s : urls) {
+            String newURL = extractURL(s);
+            if (newURL != null) {
+                input.setOriginalUrl(s);
+                input.setUrl(newURL);
+                return true;
+            }
+        }
+        return false;
+    }
+
+	public abstract String extractURL(final String baseURL) throws DownloadPluginException;
+
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    public List<String> getRegularExpression() {
+        return regularExpression;
+    }
+
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    public void setRegularExpression(final List<String> regularExpression) {
+        this.regularExpression = regularExpression;
+    }
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,60 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+	/**
+	 * If Sets the base path, the plugin will start to download from the basePath in the file system
+	 *
+	 * @param basePath
+	 *            the base path
+	 * @return the string
+	 */
+	void setBasePath(String basePath);
+
+	/**
+	 * This method retrieve the correct Url of the file from the starting URL
+	 *
+	 * @param url
+	 *            the starting url
+	 * @return the Url of the correct file
+	 */
+	DownloadItem retrieveUrl(DownloadItem item);
+
+	/**
+	 * This method retrieve the correct Url of the file from a list of starting URL
+	 *
+	 * @param urls
+	 *            the list of starting url
+	 * @return the list of the file URL
+	 */
+	Iterable<DownloadItem> retireveUrls(Iterable<DownloadItem> items);
+
+	/**
+	 * Get the name of the plugin
+	 *
+	 * @return the name of the plugin
+	 */
+	String getPluginName();
+
+
+	/**
+	 * Gets the regular expression.
+	 *
+	 * @return the regular expression
+	 */
+	List<String> getRegularExpression();
+
+
+	/**
+	 * Sets the regular expression.
+	 *
+	 * @param regularExpression the new regular expression
+	 */
+	void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,55 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+    /**
+     * If Sets the base path, the plugin will start to download from the basePath in the file system
+     *
+     * @param basePath the base path
+     * @return the string
+     */
+    void setBasePath(String basePath);
+
+    /**
+     * This method retrieve the correct Url of the file from the starting URL
+     *
+     * @param url the starting url
+     * @return the Url of the correct file
+     */
+    DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
+
+    /**
+     * This method retrieve the correct Url of the file from a list of starting URL
+     *
+     * @param urls the list of starting url
+     * @return the list of the file URL
+     */
+    Iterable<DownloadItem> retrieveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
+
+    /**
+     * Get the name of the plugin
+     *
+     * @return the name of the plugin
+     */
+    String getPluginName();
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    List<String> getRegularExpression();
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    void setRegularExpression(final List<String> regularExpression);
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,25 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(String string) {
+		super(string);
+		// TODO Auto-generated constructor stub
+	}
+	
+	public DownloadServiceException(String string, Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+public class DownloadPluginException extends RuntimeException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -8480343562060711656L;
+
+	public DownloadPluginException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadPluginException(final Throwable exception) {
+		super(exception);
+	}
+
+	public DownloadPluginException(final String msg) {
+		super(msg);
+
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(final String string) {
+		super(string);
+	}
+
+	public DownloadServiceException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(final Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,42 @@
+package eu.dnetlib.data.download.rmi;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+	/**
+	 * If Sets the base path, the plugin will start to download from the basePath in the file system
+	 *
+	 * @param basePath
+	 *            the base path
+	 * @return the string
+	 */
+	void setBasePath(String basePath);
+
+	/**
+	 * This method retrieve the correct Url of the file from the starting URL
+	 *
+	 * @param url
+	 *            the starting url
+	 * @return the Url of the correct file
+	 */
+	DownloadItem retrieveUrl(DownloadItem item);
+
+	/**
+	 * This method retrieve the correct Url of the file from a list of starting URL
+	 *
+	 * @param urls
+	 *            the list of starting url
+	 * @return the list of the file URL
+	 */
+	Iterable<DownloadItem> retireveUrls(Iterable<DownloadItem> items);
+
+	/**
+	 * Get the name of the plugin
+	 *
+	 * @return the name of the plugin
+	 */
+	String getPluginName();
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,8 ##
+*.iml
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,25 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(String string) {
+		super(string);
+		// TODO Auto-generated constructor stub
+	}
+	
+	public DownloadServiceException(String string, Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/pom.xml	(revision 45176)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.3.0</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.9</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/AbstractDownloadPlugin.java	(revision 45176)
@@ -0,0 +1,101 @@
+package eu.dnetlib.data.download.rmi;
+
+import com.google.gson.Gson;
+import eu.dnetlib.data.download.rmi.DownloadItem.OpenAccessValues;
+import org.joda.time.DateTime;
+import org.joda.time.Days;
+
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class AbstractDownloadPlugin.
+ */
+public abstract class AbstractDownloadPlugin {
+
+    /**
+     * The regular expression.
+     */
+    protected List<String> regularExpression;
+
+
+    /**
+     * Check open access.
+     *
+     * @param input the input
+     * @return the download item
+     */
+    public DownloadItem checkOpenAccess(final DownloadItem input) {
+        if (input != null) {
+            OpenAccessValues openAccess = OpenAccessValues.valueOf(input.getOpenAccess());
+            switch (openAccess) {
+                case OPEN:
+                    return input;
+                case CLOSED:
+                case RESTRICTED:
+                case UNKNOWN:
+                    return null;
+                case EMBARGO:
+                    if (input.getEmbargoDate() == null) return null;
+                    DateTime embargoDate = new DateTime(input.getEmbargoDate());
+                    DateTime today = new DateTime();
+                    Days days = Days.daysBetween(embargoDate, today);
+                    if (days.getDays() <= 0) return input;
+                    return null;
+            }
+        }
+        return null;
+    }
+
+
+    public DownloadItem filterByRegexp(final DownloadItem input) {
+        if (this.regularExpression != null && this.regularExpression.size() > 0) {
+            final String baseURLs = input.getUrl();
+            final List<String> urlsList = new Gson().fromJson(baseURLs, List.class);
+
+            for (final String baseURL : urlsList) {
+                for (final String regExp : regularExpression) {
+                    if (baseURL.matches(regExp))
+                        return input;
+                }
+            }
+            return null;
+        } else return input;
+    }
+
+    protected boolean checkUrlsNotNull(DownloadItem input, List<String> urls) {
+        for (String s : urls) {
+            String newURL = extractURL(s);
+            if (newURL != null) {
+                input.setOriginalUrl(s);
+                input.setUrl(newURL);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public abstract String extractURL(final String baseURL);
+
+
+    /**
+     * Gets the regular expression.
+     *
+     * @return the regular expression
+     */
+    public List<String> getRegularExpression() {
+        return regularExpression;
+    }
+
+
+    /**
+     * Sets the regular expression.
+     *
+     * @param regularExpression the new regular expression
+     */
+    public void setRegularExpression(final List<String> regularExpression) {
+        this.regularExpression = regularExpression;
+    }
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.3.0
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,8 ##
+*.iml
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/pom.xml	(revision 45176)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.1.0</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/pom.xml	(revision 45176)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.0.1</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,33 @@
+package eu.dnetlib.data.download.rmi;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+	/**
+	 * This method retrieve the correct Url of the file from the starting URL
+	 * 
+	 * @param url
+	 *            the starting url
+	 * @return the Url of the correct file
+	 */
+	DownloadItem retrieveUrl(DownloadItem item);
+
+	/**
+	 * This method retrieve the correct Url of the file from a list of starting URL
+	 * 
+	 * @param urls
+	 *            the list of starting url
+	 * @return the list of the file URL
+	 */
+	Iterable<DownloadItem> retireveUrls(Iterable<DownloadItem> items);
+
+	/**
+	 * Get the name of the plugin
+	 * 
+	 * @return the name of the plugin
+	 */
+	String getPluginName();
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/pom.xml	(revision 45176)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.0.0</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadPlugin.java	(revision 45176)
@@ -0,0 +1,33 @@
+package eu.dnetlib.data.download.rmi;
+
+/**
+ * The DownloadPluin should retrieve the correct URL of the file to download
+ */
+public interface DownloadPlugin {
+
+	/**
+	 * This method retrieve the correct Url of the file from the starting URL
+	 * 
+	 * @param url
+	 *            the starting url
+	 * @return the Url of the correct file
+	 */
+	DownloadItem retrieveUrl(DownloadItem item);
+
+	/**
+	 * This method retrieve the correct Url of the file from a list of starting URL
+	 * 
+	 * @param urls
+	 *            the list of starting url
+	 * @return the list of the file URL
+	 */
+	Iterable<DownloadItem> retireveUrls(Iterable<DownloadItem> items);
+
+	/**
+	 * Get the name of the plugin
+	 * 
+	 * @return the name of the plugin
+	 */
+	String getPluginName();
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/test/java/eu/dnetlib/data/download/rmi/DownloadItemTest.java	(revision 45176)
@@ -0,0 +1,18 @@
+package eu.dnetlib.data.download.rmi;
+
+import junit.framework.Assert;
+
+/**
+ * Created by sandro on 3/21/14.
+ */
+public class DownloadItemTest {
+
+	@org.junit.Test
+	public void testGetFileName() throws Exception {
+		DownloadItem di = new DownloadItem();
+		di.setIdItemMetadata("id1");
+		di.setUrl("http://www.test.com");
+		di.setFileName("testFile");
+		Assert.assertEquals("testFile", di.getFileName());
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginException.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+public class DownloadPluginException extends RuntimeException {
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = -8480343562060711656L;
+
+	public DownloadPluginException(final String string, final Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadPluginException(final Throwable exception) {
+		super(exception);
+	}
+
+	public DownloadPluginException(final String msg) {
+		super(msg);
+
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,25 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(String string) {
+		super(string);
+		// TODO Auto-generated constructor stub
+	}
+	
+	public DownloadServiceException(String string, Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/pom.xml
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/pom.xml	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/pom.xml	(revision 45176)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+		<relativePath />
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>dnet-download-service-rmi</artifactId>
+	<version>1.2.0</version>
+	<scm>
+		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0</developerConnection>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-rmi-api</artifactId>
+			<version>[2.0.0,3.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-misc-utils</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${google.gson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-beans</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,190 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Date;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+
+public class DownloadItem {
+
+	public enum OpenAccessValues {
+		OPEN, RESTRICTED, CLOSED, EMBARGO, UNKNOWN
+	}
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL. */
+	private String originalUrl;
+
+	/** The open access. */
+	private OpenAccessValues openAccess;
+
+	/** The embargo date. */
+	private Date embargoDate;
+
+	/**
+	 * From json.
+	 *
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	/**
+	 * To json.
+	 *
+	 * @return the string
+	 */
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 *
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 *
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 *
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 *
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=Date").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the original url.
+	 *
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the original url.
+	 *
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 *
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 *
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Gets the open access.
+	 *
+	 * @return the openAccess
+	 */
+	public String getOpenAccess() {
+		return openAccess.toString();
+	}
+
+	/**
+	 * Sets the open access.
+	 *
+	 * @param openAccess
+	 *            the openAccess to set
+	 */
+	public void setOpenAccess(final String openAccess) {
+		for (OpenAccessValues oaValue : OpenAccessValues.values()) {
+			if (oaValue.toString().trim().toLowerCase().equals(openAccess.trim().toLowerCase())) {
+				this.openAccess = oaValue;
+				return;
+			}
+		}
+		this.openAccess = OpenAccessValues.UNKNOWN;
+	}
+
+	/**
+	 * Gets the embargo date.
+	 *
+	 * @return the embargoDate
+	 */
+	public Date getEmbargoDate() {
+		return embargoDate;
+	}
+
+	/**
+	 * Sets the embargo date.
+	 *
+	 * @param embargoDate
+	 *            the embargoDate to set
+	 */
+	public void setEmbargoDate(final Date embargoDate) {
+		this.embargoDate = embargoDate;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.2.0
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadServiceException.java	(revision 45176)
@@ -0,0 +1,25 @@
+package eu.dnetlib.data.download.rmi;
+
+import eu.dnetlib.common.rmi.RMIException;
+
+public class DownloadServiceException extends RMIException{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5031281288958769185L;
+
+	public DownloadServiceException(String string) {
+		super(string);
+		// TODO Auto-generated constructor stub
+	}
+	
+	public DownloadServiceException(String string, Throwable exception) {
+		super(string, exception);
+	}
+
+	public DownloadServiceException(Throwable exception) {
+		super(exception);
+	}
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadService.java	(revision 45176)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import eu.dnetlib.common.rmi.BaseService;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://services.dnetlib.eu/")
+public interface DownloadService extends BaseService {
+
+	/**
+	 * Download the file in the resultset to the objectStore.
+	 *
+	 * @param resultSet
+	 *            the resultset of the url Object
+	 * @param plugin
+	 *            the name of the plugin to be applied to retrieve the URL
+	 * @param objectStoreID
+	 *            the object store id where download the file
+	 * @throws DownloadServiceException
+	 *             the download service exception
+	 */
+	@WebMethod(operationName = "downloadFromResultSet", action = "downloadFromResultSet")
+	public void downloadFromResultSet(W3CEndpointReference resultSet, String plugin, String objectStoreID, String protocol, String mimeType)
+			throws DownloadServiceException;
+
+	@WebMethod(operationName = "listPlugins", action = "listPlugins")
+	public List<String> listPlugins() throws DownloadServiceException;
+
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.1.0
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/src/main/java/eu/dnetlib/data/download/rmi/DownloadPluginEnumerator.java	(revision 45176)
@@ -0,0 +1,23 @@
+package eu.dnetlib.data.download.rmi;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.BeanFactoryAware;
+
+public interface DownloadPluginEnumerator extends BeanFactoryAware {
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getAll();
+	
+	/**
+	 * Get all beans implementing the DownloadPlugin interface, hashed by name.
+	 * 
+	 * @return
+	 */
+	Map<String, DownloadPlugin> getByProtocols();
+	
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.1
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+.project
+.classpath
+target
+testbin
+.settings
+
+
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/src/main/java/eu/dnetlib/data/download/rmi/DownloadItem.java	(revision 45176)
@@ -0,0 +1,123 @@
+package eu.dnetlib.data.download.rmi;
+
+import com.google.gson.Gson;
+
+import eu.dnetlib.miscutils.functional.hash.Hashing;
+
+/**
+ * Download Item Class that serialize information in the resultset.
+ */
+public class DownloadItem {
+
+	/** The id item metadata. */
+	private String idItemMetadata;
+
+	/** The Url. */
+	private String Url;
+
+	/** The file name. */
+	private String fileName;
+
+	/** The original URL should be appear instead of the downloaded URL */
+	private String originalUrl;
+
+	/**
+	 * From json.
+	 * 
+	 * @param inputJson
+	 *            the input json
+	 * @return the download item
+	 */
+	public static DownloadItem newObjectfromJSON(final String inputJson) {
+		Gson g = new Gson();
+		DownloadItem instance = g.fromJson(inputJson, DownloadItem.class);
+		return instance;
+	}
+
+	public String toJSON() {
+		return new Gson().toJson(this).replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Gets the id item metadata.
+	 * 
+	 * @return the id item metadata
+	 */
+	public String getIdItemMetadata() {
+		return idItemMetadata;
+	}
+
+	/**
+	 * Sets the id item metadata.
+	 * 
+	 * @param idItemMetadata
+	 *            the new id item metadata
+	 */
+	public void setIdItemMetadata(final String idItemMetadata) {
+		this.idItemMetadata = idItemMetadata;
+	}
+
+	/**
+	 * Gets the url.
+	 * 
+	 * @return the url
+	 */
+	public String getUrl() {
+		if (Url == null) return null;
+		return Url.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * Sets the url.
+	 * 
+	 * @param url
+	 *            the new url
+	 */
+	public void setUrl(final String url) {
+		if (url == null) {
+			Url = null;
+		} else {
+			Url = url.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * @return the originalUrl
+	 */
+	public String getOriginalUrl() {
+		if (originalUrl == null) return null;
+		return originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+	}
+
+	/**
+	 * @param originalUrl
+	 *            the originalUrl to set
+	 */
+	public void setOriginalUrl(final String originalUrl) {
+		if (originalUrl == null) {
+			this.originalUrl = null;
+		} else {
+			this.originalUrl = originalUrl.replace("\\u003d", "=").replace("\\u0026", "&");
+		}
+	}
+
+	/**
+	 * Gets the file name.
+	 * 
+	 * @return the file name
+	 */
+	public String getFileName() {
+		if ((fileName == null) || "".equals(fileName)) return getIdItemMetadata() + "::" + Hashing.md5(getOriginalUrl());
+		return fileName;
+	}
+
+	/**
+	 * Sets the file name.
+	 * 
+	 * @param fileName
+	 *            the new file name
+	 */
+	public void setFileName(final String fileName) {
+		this.fileName = fileName;
+	}
+}
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/deploy.info
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/deploy.info	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0/deploy.info	(revision 45176)
@@ -0,0 +1 @@
+{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service-rmi/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "dnet-download-service-rmi"}
\ No newline at end of file
Index: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0
===================================================================
--- modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0	(nonexistent)
+++ modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0	(revision 45176)

Property changes on: modules/dnet-download-service-rmi/tags/dnet-download-service-rmi-1.0.0
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+.project
+.classpath
+target
+testbin
+.settings
+
+
