
//--------------------------------------------------------------------
// Class FileClient
//
// Purpose  : Main interactive interface with users for client file
//--------------------------------------------------------------------

import java.io.*; 

public class FileClient
{


//--------------------------------------------------------------------
// main Method
//
// Input	: None
// Output   : None
// Purpose  : create interactive interface with user
//--------------------------------------------------------------------

	public static void main (String args[])
	{
		Library library = new Library();
		System.out.println("type -help- for list of available commands");
		System.out.print(library.getCurrentDirPath());
		BufferedReader input 
			= new BufferedReader(new InputStreamReader(System.in)); 

		try
		{
			// spawn for command
			while (true)
			{
				String line = input.readLine();
				try
				{
					library.commandHandler(line);
					if (line.startsWith("bye")) break;
					System.out.print("\n" + library.getCurrentDirPath());
				}
				catch (Exception e)
				{
					System.out.println(e.toString());
					System.out.print("\n" + library.getCurrentDirPath());
				}
			}
		}
		catch (Exception e)
		{
			System.out.println(e.toString());
		}
		finally
		{
			System.out.println("terminate session");
			System.exit(0);
		}
	}
}

//--------------------------------------------------------------------
// End Class FileClient
//--------------------------------------------------------------------