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
|
@XmlRootElement
|
||||||
public class HashList extends ArrayList<String>
|
public class StringList extends ArrayList<String>
|
||||||
{
|
{
|
||||||
|
|
||||||
// ======================================
|
// ======================================
|
||||||
// = Constructors =
|
// = Constructors =
|
||||||
// ======================================
|
// ======================================
|
||||||
|
|
||||||
public HashList()
|
public StringList()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashList(Collection<? extends String> c)
|
public StringList(Collection<? extends String> c)
|
||||||
{
|
{
|
||||||
super(c);
|
super(c);
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public class HashList extends ArrayList<String>
|
|||||||
// = Getters & Setters =
|
// = Getters & Setters =
|
||||||
// ======================================
|
// ======================================
|
||||||
|
|
||||||
@XmlElement(name = "hash")
|
@XmlElement(name = "string")
|
||||||
public List<String> getPackages()
|
public List<String> getPackages()
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
@@ -3,7 +3,7 @@ package org.jpacrepo.service;
|
|||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.jpacrepo.context.ApplicationContext;
|
import org.jpacrepo.context.ApplicationContext;
|
||||||
import org.jpacrepo.context.DefaultConfiguration;
|
import org.jpacrepo.context.DefaultConfiguration;
|
||||||
import org.jpacrepo.model.HashList;
|
import org.jpacrepo.model.StringList;
|
||||||
import org.jpacrepo.model.PkgData;
|
import org.jpacrepo.model.PkgData;
|
||||||
import org.jpacrepo.model.PkgList;
|
import org.jpacrepo.model.PkgList;
|
||||||
import org.jpacrepo.model.PkgName;
|
import org.jpacrepo.model.PkgName;
|
||||||
@@ -86,7 +86,17 @@ public class PacmanWebService
|
|||||||
{
|
{
|
||||||
Query query = em.createQuery("SELECT p.md5sum FROM PkgData p");
|
Query query = em.createQuery("SELECT p.md5sum FROM PkgData p");
|
||||||
List<String> hashes = query.getResultList();
|
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();
|
return Response.ok(hl).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user