File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to decode a JCAPS OTD meta file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to decode a JCAPS OTD meta file " Watch "How to decode a JCAPS OTD meta file " New topic
Author

How to decode a JCAPS OTD meta file

Praveen Chadichal
Greenhorn

Joined: Apr 07, 2009
Posts: 21
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to decode a JCAPS OTD meta file
 
Similar Threads
Searching Strings in a textfile
New IO
BufferedReader help
Reading bytes from FileChannel...
java.nio.ByteBuffer to StringBuffer