This application wraps the Odin MRI simulator. The Odin code source is available at http://od1n.sourceforge.net
/*----------Beginning of Beanshell------------*/
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis()));
/*------------End of Beanshell------------*/
String smpDir=inDir.toString();
arrayLfn = new ArrayList();
String smpLfn="";
Runtime rt = Runtime.getRuntime();
try{
String [] cmd1 = new String [2];
cmd1[0] = "lfc-ls";
cmd1[1] = smpDir;
Process p1 = rt.exec(cmd1);
p1.waitFor();
String line ="";
BufferedReader in = new BufferedReader(new InputStreamReader(p1.getInputStream()));
System.out.println(" Listing directory "+smpDir);
while(in.ready()){
line=in.readLine();
try{
System.out.println(" Line is "+line);
smpLfn=smpDir+"/"+line;
arrayLfn.add(""+smpLfn);
}catch(Exception e){
System.out.println(" exception:"+e.getMessage());
}
BufferedReader err = new BufferedReader(new InputStreamReader(p1.getErrorStream()));
while(err.ready()){
line=err.readLine();
System.out.println(" error listing directory "+smpDir+": "+line);
}
p1.getErrorStream().close();
p1.getInputStream().close();
p1.getOutputStream().close();
}
}
catch(Exception e){
System.out.println(" exception:"+e.getMessage());
}