Skip to content
Snippets Groups Projects
Commit cd48539d authored by Gonzalo Fabian Cameto Hernandez's avatar Gonzalo Fabian Cameto Hernandez
Browse files

Eliminacion de comando copy utilizado en versiones anteriores

parent b7e7cb53
No related branches found
No related tags found
No related merge requests found
......@@ -64,13 +64,6 @@ export class GHCIService {
};
this.connection.send(JSON.stringify(message));
}
copyFile(fileId){
var message = {
'token': this.authService.getToken(),
'copy': fileId
};
this.connection.send(JSON.stringify(message));
}
reiniciarInterprete(){
var message = {
'token': this.authService.getToken(),
......
......@@ -152,41 +152,6 @@ public class CommandsBean {
}
} else if (comandoJson.containsKey("restart")) {
restartProcess(this.cedula, token, session);
} else if (comandoJson.containsKey("copy")) {
int fileId = comandoJson.getInt("copy");
try {
ArchivoDTO archivo;
Usuario usuario = invitadoEJB.getUsuario(token);
if (usuario != null && usuario.getCedula().toLowerCase().equals("invitado")) {
archivo = invitadoEJB.getArchivo(token, fileId);
} else {
archivo = archivos.getArchivo(fileId);
}
String contenido = archivo.getContenido();
String fullPathMatefunTmp = context
.getRealPath("/WEB-INF/classes/edu/proygrado/binarios/MateFunTmp")+"/";
try {
File file;
if (usuario != null && usuario.getCedula().toLowerCase().equals("invitado")) {
file = new File(fullPathMatefunTmp + this.cedula + "_" + token + "/"
+ corregirNombreArchivo(archivo.getNombre()) + ".mf");
} else {
file = new File(fullPathMatefunTmp + this.cedula + "/"
+ corregirNombreArchivo(archivo.getNombre()) + ".mf");
}
file.getParentFile().mkdirs();
FileWriter writer = new FileWriter(file);
writer.write(contenido);
writer.close();
writer.flush();
} catch (IOException e) {
// do something
System.out.println(e.getMessage());
}
} catch (Exception ex) {
Logger.getLogger(CommandsBean.class.getName()).log(Level.SEVERE, null, ex);
}
}
} catch (Exception e) {
......@@ -205,11 +170,6 @@ public class CommandsBean {
return nombreCorregido;
}
private ServletContext getContext() {
// TODO Auto-generated method stub
return null;
}
public void restartProcess(String cedula, String token, Session session) throws InterruptedException {
try {
this.callback = session;
......
......@@ -5,10 +5,8 @@
*/
package edu.proygrado.servicios.ghci;
import edu.proygrado.ejb.CommandsBean;
import javax.ejb.EJB;
import javax.ejb.Stateful;
import javax.ejb.Stateless;
import javax.json.Json;
import javax.json.JsonObject;
import javax.websocket.CloseReason;
......@@ -20,6 +18,8 @@ import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import edu.proygrado.ejb.CommandsBean;
/**
*
* @author gonzalo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment