Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matefun
Frontend
Commits
cd48539d
Commit
cd48539d
authored
Nov 09, 2017
by
Gonzalo Fabian Cameto Hernandez
Browse files
Eliminacion de comando copy utilizado en versiones anteriores
parent
b7e7cb53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/src/app/shared/services/ghci.service.ts
View file @
cd48539d
...
...
@@ -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
(),
...
...
Servidor JEE/src/main/java/edu/proygrado/ejb/CommandsBean.java
View file @
cd48539d
...
...
@@ -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
;
...
...
Servidor JEE/src/main/java/edu/proygrado/servicios/ghci/WebSocketEndpoint.java
View file @
cd48539d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment