public boolean cantOpenStorage(XStorage xStorage, String sName) { // try to open an opened substorage, open call must fail try { Object oDummyStorage = xStorage.openStorageElement(sName, ElementModes.READ); Error("The trying to reopen opened substorage '" + sName + "' must fail!"); } catch (Exception e) { return true; } return false; }
public XStorage openSubStorage(XStorage xStorage, String sName, int nMode) { // open existing substorage try { Object oSubStorage = xStorage.openStorageElement(sName, nMode); XStorage xSubStorage = (XStorage) UnoRuntime.queryInterface(XStorage.class, oSubStorage); return xSubStorage; } catch (Exception e) { Error("Can't open substorage '" + sName + "', exception: " + e); } return null; }