package iDSS.utils;



import java.net.*;
import java.util.*;
import java.io.*;


public class TestRW {

    public static void main(String args[]) {

        String s = "Test string";
        boolean success = false;

        try {

            //URL url = new URL(IDSSAppConstants.modelSetupHashtableUrlName);

            File file = new File(IDSSAppConstants.modelSetupHashtableFileName);
            URL url = new URL(IDSSAppConstants.modelSetupHashtableUrlName);

            success = ObjectReadWrite.write(file,s);

            if(success) {

                System.out.println("writing successful: " + s);
                String s2 = (String)ObjectReadWrite.read(url);

                if(s2 != null) {

                    System.out.println("reading successful: " + s2);

                } //if(s2 != null)

            } //if(success)

        } //try


        catch(MalformedURLException e) {

            System.out.println(e.toString());

        } //


/**
        try {

            URL url = new URL("http://130.159.78.177:8000/slrStory/ttAll");

            Hashtable h = (Hashtable)ObjectReadWrite.read(url);

            if(h != null) {

                Enumeration keys = h.keys();

                while(keys.hasMoreElements()) {

                    String key = (String)keys.nextElement();
                    String value = (String)h.get(key);

                    System.out.println(key + "    " + value);

                } //while(keys.hasMoreElements())

            } //if(h != null)

        } //try

        catch(MalformedURLException e) {

            System.out.println(e.toString());

        } //

**/

    } //main




} //public class TestRW


