Java Applet

To perform a file transfer, TIBCO MFT Command Center File Transfer Java applet must be used.

The File Transfer applet consists of three .jar files. They are located in the following directories on the TIBCO MFT Command Center server:
  • <MFT_Install>/view/filetransfer/java/JavaApplet_0.0.0.1.jar
  • <MFT_Install>/view/filetransfer/java/httpcore-4.3.2.jar
  • <MFT_Install>/view/filetransfer/java/httpcore-nio-4.3.2.jar

The File Transfer applet can be embedded in an HTML page, or it can be embedded in a Java application. The following HTML code snippet embeds the File Transfer applet into HTML page that can only be accessed by Microsoft Internet Explorer:

<object	
	ID = "FileTransferApplet"
	classid = "clsid:CAFEEFAC-0014-0001-0003-ABCDEFFEDCBA" 
	width = "1" 
	height = "1"
>
      <param name="CODE" value= 
      "com.TIBCO.cfcc.fileTransferApplet.nongui.NonGUIApplet.class">
	<param name="ARCHIVE" value = “[Path to File Transfer Applet jar files]”>
       <param name="FileTransferServletURL" value="https://[DNS 
       HostName]:[httpsPort]/cfcc/control?view=servlet/fileTransfer">
	<param name="TransferDirection" value= "[SEND or RECEIVE]">	
	<param name="FileID" value= "[File ID to be transferred]">
	<param name="LocalFileName" value= "[File name as it exists on client]" >
       <param name="SessionID" value= "[Session ID retrieved from service getSession 
       call]">
	<param name="Compression" value="[Yes or No]">
	<param name="TraceLevel" value=”[TraceLevel 1-10]”>
	<param name="type" value= "application/x-java-applet;version=1.6.0">

 <comment>
		      <embed 
			            type="application/x-java-applet;jpi-version=1.6.0" 
                    java_CODE="com.TIBCO.cfcc.fileTransferApplet.nongui.NonGUIApplet.
                    class" 
			            java_ARCHIVE= "[Path to File Transfer Applet jar files]"
			            WIDTH="1"	
			            HEIGHT="1"

                    FileTransferServletURL=" https://[DNS 
                    HostName]:[httpsPort]/cfcc/control?view=servlet/fileTransfer"
			            TransferDirection="[SEND or RECEIVE]"
			            FileID="[File ID to be transferred]"
			            LocalFileName="[File name as it exists on client]"
                    SessionID="[Session ID retrieved from service getSession call]"
			            Compression="[Yes or No]"
			            TraceLevel="[TraceLevel 1-10]"
			            MAYSCRIPT=true
		>
		<noembed>
               No Java 2 SDK, Standard Edition v 1.8 support for APPLET!!
		</noembed>
		</embed>
	</comment>
</object>

The following code snippet embeds the File Transfer applet into a Java application:

System.setProperty("FileTransferServletURL", "https://[DNSHostName]:[httpsPort]/cfcc/control?view=servlet/fileTransfer");
System.setProperty("SessionID", "[Session ID retrieved from service getSession call]");
System.setProperty("TransferDirection", "[SEND or RECEIVE]");
System.setProperty("FileID", "[File name as it exists on client]");
System.setProperty("LocalFileName", "[File name as it exists on client]");
System.setProperty("Compression", "[Yes or No]");
 
theApplet =new NonGUIApplet();
theApplet.setStub(this);
this.setApplet(theApplet);
theApplet.init();
theApplet.start();
status=((NonGUIApplet)theApplet).getReturnCode();   	   				
bytes=((NonGUIApplet)theApplet).getBytesTransfered();
compressedBytes=((NonGUIApplet)theApplet).getCompressedByte();

The System.setProperty method is used to pass initialization parameters to the File Transfer applet.