Initial commit
This commit is contained in:
81
src/com/flaremicro/crossjeeves/net/ClientHandler.java
Normal file
81
src/com/flaremicro/crossjeeves/net/ClientHandler.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.flaremicro.crossjeeves.net;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet0Identify;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet127KeepAlive;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet1Status;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet2Script;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet3Clone;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet4FileData;
|
||||
import com.flaremicro.crossjeeves.net.packet.Packet5Artifact;
|
||||
import com.flaremicro.util.ZipUtils;
|
||||
|
||||
public class ClientHandler extends NetworkHandler {
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet0Identify packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet1Status packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet2Script packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet3Clone packet) {
|
||||
long fileId = packet.getFileID();
|
||||
String workspace = System.getenv("WORKSPACE");
|
||||
if(workspace == null || workspace.trim().length() <= 0)
|
||||
{
|
||||
//disconnect
|
||||
}
|
||||
try
|
||||
{
|
||||
File workspaceZip = File.createTempFile("workspace-"+fileId, ".zip");
|
||||
ZipUtils.zipDirectory(new File(workspace), workspaceZip);
|
||||
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
//disconnect
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet4FileData packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet5Artifact packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Packet127KeepAlive packet) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user