Skip to content
Snippets Groups Projects
Commit 83e25f0e authored by andres's avatar andres
Browse files

Descarga nook bien sin archivos

parent db414ee4
Branches
No related tags found
No related merge requests found
......@@ -55,9 +55,16 @@ public class descargarNookSV extends HttpServlet {
dispatcher.forward(request, response);
}else{
String userName = (String) session.getAttribute("usuario");
boolean doc = true;
int nook = Integer.parseInt(request.getParameter("idNook"));
ArrayList<Documento> documentos = documentoDB.getFiles(nook);
ArrayList<Documento> documentos = documentoDB.getDocumentosNook(nook);
for(int i=0; i<documentos.size(); i++){
if(documentos.get(i).getDocumento()==null){
doc=false;
}
}
if(doc){
documentos = documentoDB.getFiles(nook);
ArrayList<String> archivos = new ArrayList();
Nook nookO = nookDB.getNook(nook);
String zipName = nookO.getNombre() + ".zip";
......@@ -124,6 +131,11 @@ public class descargarNookSV extends HttpServlet {
deleteDirectory(new File("temp" + File.separator + nook));
nookDB.actualizarDescargas(nook, nookO.getDescargas()+1);
} else{
String url = "/nookSV?"+nook;
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
dispatcher.forward(request, response);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment