0 Replies Latest reply: Aug 11, 2011 2:50 AM by 849915 RSS

    How to decode a JCAPS OTD meta file

    849915
      Hi,
      Can anyone help me to knw how to decode a JCAPS generated OTD meta file. I am using this for a migration purpose. My meta file looks something like this below:
      *******************************************
      # This is the OTD metadata, generated by FogMeta.
      # Format: @index id info display-name Java-name class
      # Id is parent-node key + '.' + child-index.
      # Info is type-letter + optional info flags.
      # Flags: '*'=repeat, '?'=optional, '<'=read, '>'=write.
      # --------------------------------
      @0 54.0.0 n?=<> 0 - fileInputOTD Fileinputotd +ud1.fileInputOTD_34597888.Env1.Fileinputotd
      @1 54.1.0 n=<> 0 - inputElem Inputelem +ud1.fileInputOTD_34597888.Env1.Inputelem
      @2 54.2.0 o=<> 0 - CustID Custid -
      @3 54.2.1 o=<> 1 - Fname Fname -
      @4 54.2.2 o=<> 2 - Lname Lname -
      @5 54.2.3 o=<> 3 - minSalary Minsalary -
      @6 54.2.4 o=<> 4 - incentive Incentive -
      # Fileinputotd = 0
      %54.0.0 0 1 1 -
      %54.1.0 1 5 2 3 4 5 6 -
      *******************************************
      and my decoding code as below:
      File file = new File("D:/FileTransfer_otdEmployeeInfo/ud1/otdEmployeeInfo329435304/otd.meta");
      FileInputStream in = new FileInputStream(file);
      FileChannel channel = in.getChannel();
      ByteBuffer byteBuffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, file.length());
      Charset charset = Charset.forName("iso-8859-1");
      CharsetDecoder decoder = charset.newDecoder();
      CharBuffer charBuffer = decoder.decode(byteBuffer);
      channel.close();
      String s = charBuffer.toString();
      System.out.println(s);
      My above code prints the same file content as the encoded one meaning the meta data. .
      Can anyone help how can i achieve in getting decoded content? Your immediate response is deeply appreciated