JOCPaintFTPRefresh java applet

Introduction

This java applet refreshes continuously a image that can be upgraded at any time, this allows you to see in your browser the last version of the image, in the figure 1 you can see an example.

Chrome java applet exmaple

Figure 1: Chrome java applet exmaple

Used technologies

Java, FTP

Signed applet installation instructions

  1. Download the .jar signed file in the following link JOCPaintFTPRefresh.jar (SIGNED)
  2. Download the launcher.html or create yourself a html launcher (see figure 2)
  3. Save the downloaded files in the same folder in your computer.
  4. Configure the FTP server parameters that will be use the applet to extract the paintings data by editing the following parameters of: launcher.html:
  5. strFTPServer (put in “value” the IP or URL of your FTP server address)
  6. nFTPPort (put in “value” the FTP port of your FTP server )
  7. strFTPLogin (put in “value” the FTP login)
  8. strFTPPass (put in “value” the FTP pass)
  9. strFTPDirName (put in “value” the FTP directory to use)
  10. strFTPFileName (put in “value” the FTP filename to use)
  11. Finally open the launcher.html file using any web browser (Except IE)
  12. (the unsigned applet can be deployed using a webserver)

Remember that the FTP connection is done from the browser side and it uses FTP passive mode, these means that the network configuration have to allow TCP connections from browser’s PC to FTP server.

Unsigned applet installation instructions

  1. Download the .jar file in the following link JOCPaintFTPRefresh.jar
  2. Download the launcher.html or create yourself a html launcher (see figure 2)
  3. Save the downloaded files in the same folder in your computer.
  4. Configure the FTP server parameters that will be use the applet to extract the paintings data by editing the following parameters of: launcher.html:
    1. strFTPServer (put in “value” the IP or URL of your FTP server address)
    2. nFTPPort (put in “value” the FTP port of your FTP server )
    3. strFTPLogin (put in “value” the FTP login)
    4. strFTPPass (put in “value” the FTP pass)
    5. strFTPDirName (put in “value” the FTP directory to use)
    6. strFTPFileName (put in “value” the FTP filename to use)
  5. Set the security level of java to medium (see instructions). This allows your browser to start local java applets.
  6. [This step is not necessary if the FTP server has the same address as web server] Add the following text to the [java installation root]/java/jre/lib/security/java.policy (this allows the applet to connect to the FTP server):

grant codeBase “file:[installation path]/JOCPaintFTPRefresh.jar” {permission java.net.SocketPermission “*:21-“, “connect,resolve”;};

    7. Finally open the launcher.html file using any web browser (Except IE)
The unsigned applet can be deployed using a webserver

 

 <Html>

    <Head>
        <Title>Java JOCFTPPaint Refresh by Jordi Cenzano</Title>
    </Head>
    <Body>
        <Applet archive="JOCPaintFTPRefresh.jar" Code="CJOCPaintFTPMain.class" width=100% Height=100%>
            <param name="strFTPServer"  value="192.168.1.20" >
            <param name="nFTPPort"  value="21" >
            <param name="strFTPLogin"  value="androidpaint" >
            <param name="strFTPPass"  value="joc" >
            <param name="strFTPDirName"  value="paint" >
            <param name="strFTPFileName"  value="test.png" >
        </Applet>
    </Body>
</Html> 
 Figure 2

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: