//package net.certivo.transport;

import java.rmi.RemoteException;
import java.rmi.Naming;
import java.io.File;

public class TransportClient	{

	public static void main(String args[])	{

		TransportObject  obj = null;
		//File xmlFile = null;

		try	{
			//String name = "//" + args[0] + "/TransportObject";
			obj = (TransportObject)Naming.lookup("TransportObject");
			File xmlFile = (File) obj.getXMLFile();
			System.out.println("File method called");
			if (xmlFile.exists() )	{
				System.out.println("File exists");
				if (xmlFile.canRead() )	{
					System.out.println("File is readable");
					String fileName = xmlFile.getName();
					String filePath = xmlFile.getAbsolutePath();
					System.out.println("path" +filePath);
					File f = new File("C:\\net\\newpo.xml");
					System.out.println(xmlFile.renameTo(f));
					System.out.println(f.exists());
					System.out.println("XMl file loaded successfully :  " +f.getAbsolutePath());
				}
			}
		}catch( Exception e )	{
			System.err.println("TransportClient cannot load XML File " +e.getMessage());
			e.printStackTrace();
		}
	}
}