Back *|* JavaScript *|* Timer sample
The FTP transfer of the images, and GPS data is through some great java code ...
import java.io.*; import sun.net.ftp.FtpClient; public class FtpExample { public static void main(String args[]) throws Exception { FtpClient fc; int argc = args.length; // get input arguments if (argc != 4) { System.out.println("USAGE: FtpExample host path/file username password"); System.exit(1); } String host = args[0]; String path = args[1]; String username = args[2]; String password = args[3]; int lastSlash = path.lastIndexOf('/'); String filename = path.substring(lastSlash+1); String directory = path.substring(0,lastSlash); System.out.println("FtpExample host=["+host+"] path=["+directory+"]/file=["+filename+"]"); System.out.println("username=["+username+"] password=["+password+"]..."); FtpClient client = new FtpClient(host); client.login(username, password); client.binary(); client.cd(directory); InputStream is = client.get(filename); BufferedInputStream bis = new BufferedInputStream(is); OutputStream os = new FileOutputStream(filename); BufferedOutputStream bos = new BufferedOutputStream(os); byte[] buffer = new byte[1024]; int readTotal = 0; int readCount; System.out.println("Getting: " + filename + " ..."); while( (readCount = bis.read(buffer)) > 0) { bos.write(buffer, 0, readCount); readTotal += readCount; } bos.close(); // client.closeServer(); System.out.println("Read, and Wrote: " + filename + " ... " + readTotal + " bytes ..."); System.exit(0); } } // eof
top