JODConverter を使用して .xls と .ppt を .pdf 形式に変換しています。このために、私は次のようなコードを持っています
try{
//do something
System.out.println("connecting to open office");
OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
System.out.println("connection object created");
connection.connect();
System.out.println("connection to open office successful");
//do something
if(!successful)
throw new FileNotFoundException();
}catch(Exception e){
System.out.println("hello here");
System.out.println("Caught Exception while converting to PDF ");
LOGGER.error("Error in converting media" + e.getMessage());
throw new MediaConversionFailedException();
}finally{
decode_pdf.closePdfFile();
System.out.println("coming in finally");
//do something here
}
私の出力:
connecting to open office
connection object created
coming in finally
メソッドの PS 戻り値の型はvoid
どのように可能ですか?connection.connect() に何らかの問題があっても、catch ブロックに入っています。混乱している