views:

11

answers:

0

I have been trying to interpret a session file created by GeoCortex IMF framework manually. I know that a session file is a serialized java object. I found some code that would deserialize the object but it only reads the first line. The code is:

import java.io.*;

  public class DeserializingObject{

  public static void main(String[] args) throws IOException{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("Enter File name : ");

    String file = in.readLine();

  System.out.print("Enter extention : ");

    String ext = in.readLine();

   String filename = file + "." + ext;

   File f = new File(filename);

   try{

   ObjectInputStream obj = new ObjectInputStream(new FileInputStream(f));
      System.out.println("The text : "+  obj.readObject());
      obj.close();
      System.out.println("Deserializing Operation Completly Successfully.");

   }

 catch(ClassNotFoundException e){

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

    }

   catch(FileNotFoundException fe){

      System.out.println("File not found ");

   }

 }

}

I can get this to read the file, but it only give me one line com.moximedia.aims is the output. Was wondering what I am doing wrong. I want to be able to read this session file, update some information in it, and reserialize the file to be read by the application. I do not know java and can not figure out where this code is going wrong. Basically, this is a map server and I am trying to do this as a standalone application.

Any help will be better then no help at all.