modifiche per permettere al client di fare i confronti sui nomi dei file anzichè sugli hash
This commit is contained in:
@@ -12,19 +12,19 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
@XmlRootElement
|
||||
public class HashList extends ArrayList<String>
|
||||
public class StringList extends ArrayList<String>
|
||||
{
|
||||
|
||||
// ======================================
|
||||
// = Constructors =
|
||||
// ======================================
|
||||
|
||||
public HashList()
|
||||
public StringList()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public HashList(Collection<? extends String> c)
|
||||
public StringList(Collection<? extends String> c)
|
||||
{
|
||||
super(c);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class HashList extends ArrayList<String>
|
||||
// = Getters & Setters =
|
||||
// ======================================
|
||||
|
||||
@XmlElement(name = "hash")
|
||||
@XmlElement(name = "string")
|
||||
public List<String> getPackages()
|
||||
{
|
||||
return this;
|
@@ -3,7 +3,7 @@ package org.jpacrepo.service;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jpacrepo.context.ApplicationContext;
|
||||
import org.jpacrepo.context.DefaultConfiguration;
|
||||
import org.jpacrepo.model.HashList;
|
||||
import org.jpacrepo.model.StringList;
|
||||
import org.jpacrepo.model.PkgData;
|
||||
import org.jpacrepo.model.PkgList;
|
||||
import org.jpacrepo.model.PkgName;
|
||||
@@ -86,7 +86,17 @@ public class PacmanWebService
|
||||
{
|
||||
Query query = em.createQuery("SELECT p.md5sum FROM PkgData p");
|
||||
List<String> hashes = query.getResultList();
|
||||
HashList hl = new HashList(hashes);
|
||||
StringList hl = new StringList(hashes);
|
||||
return Response.ok(hl).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("files")
|
||||
public Response getFiles()
|
||||
{
|
||||
Query query = em.createQuery("SELECT p.fileName FROM PkgData p");
|
||||
List<String> hashes = query.getResultList();
|
||||
StringList hl = new StringList(hashes);
|
||||
return Response.ok(hl).build();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user