| 1 package com.sslexplorer.agent.client.applications; 2 3 import java.io.IOException ; 4 5 import com.maverick.multiplex.Channel; 6 import com.maverick.util.ByteArrayWriter; 7 8 public class ApplicationFileChannel extends Channel { 9 10 11 public static final String CHANNEL_TYPE = "applicationFile@3sp.com"; 12 13 String name; 14 String ticket; 15 String filename; 16 17 18 public ApplicationFileChannel(String name, String ticket, String filename) { 19 super(CHANNEL_TYPE, 32768, 35000); 20 this.name = name; 21 this.ticket = ticket; 22 this.filename = filename; 23 } 24 25 public byte[] create() throws IOException { 26 27 try { 28 ByteArrayWriter msg = new ByteArrayWriter(); 29 msg.writeString(name); 30 msg.writeString(ticket); 31 msg.writeString(filename.replace('\\', '/')); 32 33 return msg.toByteArray(); 34 } catch (IOException e) { 35 throw new IOException ("Failed to create application descriptor channel open request message"); 36 } 37 38 } 39 40 public void onChannelClose() { 41 43 } 44 45 public void onChannelOpen(byte[] data) { 46 48 } 49 50 public byte[] open(byte[] data) throws IOException { 51 throw new IOException ("Application file channel cannot be opened on the client"); 52 } 53 54 } | Popular Tags |