Hello All,
I am using JStarBurn SDK and DLLs with JAVA , I have Implemented a code which can take a file from my hard disk which is to be written to the CD.
It shows that program runs successfully and also CD drive seems to writing (acting) something but it never shows any data in the written CD, also it locked the CD for any further writing (even if I am writing only few KB data), I have corrupted 2-3 CDs because of this.
I am sending the code below. Here "F:" is the CD/DVD writer drive name and "mma_ons.txt" is the file name to be written on the CD.
This sample is also taken from your SDK samples(BurnTree) and I modified it according to my use and also I am not supplying the arguments through argument list in main as I am developing it on Netbeans IDEs.
public void burn()
{
try
{
JStarBurnBurnerGrabber.register(null);
JStarBurnBurnerGrabber jstarburnburnergrabber = null;
jstarburnburnergrabber = new JStarBurnBurnerGrabber("F:", new Callback());
DiscInfo discinfo = jstarburnburnergrabber.getDiscInformation();
if(discinfo.getType() == 14)
{
System.out.println("no disc");
throw new JStarBurnException("No disc in drive");
}
jstarburnburnergrabber.setTestMode(true);
jstarburnburnergrabber.setVerifyNeeded(true);
jstarburnburnergrabber.CollisionDetectionDisabled(true);
jstarburnburnergrabber.addFile("C:\\Documents and Settings\\akhilk\\Desktop\\mma_ons.txt");
jstarburnburnergrabber.createDir("test");
jstarburnburnergrabber.addFile("test", "C:\\Documents and Settings\\akhilk\\Desktop\\mma_ons.txt");
// if(as.length < 4)
// jstarburnburnergrabber.saveTreeToImage("F:"); //
If I uncomment this line I get exception of
// // com.rocketdivision.jstarburn.JStarBurnException: CStarBurn_ISO9660FileTree::
//// BuildImage(): m__BOOLEAN__IsImageBuild is TRUE already at
// // com.rocketdivision.jstarburn.JStarBurnBurnerGrabber.burnTree(Native Method)
// else
jstarburnburnergrabber.burnFileTree();
jstarburnburnergrabber.ejectDisc();
System.out.println("finished!");
jstarburnburnergrabber.freeResources();
JStarBurnBurnerGrabber.unregister();
}
catch(Exception exception)
{
exception.printStackTrace();
System.out.println((new StringBuilder()).append("Error occured. Error message: ").append(exception.getMessage()).toString());
}
}
}
Please guide me if I am doing something wrong.
Thanks in advance
Akhil