About validating openoffice home and openoffice profile

14 views
Skip to first unread message

Asiri Rathnayake

unread,
Mar 5, 2009, 11:38:23 PM3/5/09
to jodcon...@googlegroups.com
Hi Mirko and List :)


I noticed that when creating an instance of ManagedOfficeProcess class, an IllegalArgumentException is thrown if either of the officehome or the offieprofile paths does not exists. But still when ManagedOfficeProcess class creates an internal OfficeProcess instance it doesn't check whether the excutable files exists:

<code>
public class OfficeProcess {

/*...*/

public OfficeProcess(File officeHome, String acceptString, File profileDir) {
        this.officeHome = officeHome;
        this.acceptString = acceptString;
        this.profileDir = profileDir;
}

public void start() throws IOException {
        List<String> command = new ArrayList<String>();
        command.add(new File(officeHome, getExecutablePath()).getAbsolutePath());
        /*.....*/
}

private String getExecutablePath() {
        if (OsUtils.isMac()) {
            return "MacOS/soffice.bin";
        } else {
            return "program/soffice.bin";
        }
}
<code>

I think it would be nice if OfficeProcess constructor could also throw an IllegalArgumentException if the soffice.bin file does not exist. Such situations can occur because these information are taken from configuration files most of the time. Same concept could be applied to validating officeprofile path but I'm not sure if there is a unque way to do it.

WDYT?

Thanks.

- Asiri

Mirko Nasato

unread,
Mar 6, 2009, 4:59:24 AM3/6/09
to jodcon...@googlegroups.com
Hi Asiri,

Yes we should do these additional checks. I've created an issue

http://code.google.com/p/jodconverter/issues/detail?id=34

Thanks

Mirko


2009/3/6 Asiri Rathnayake <asiri.ra...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages