protected void openSupport(String reason) throws FMFileManagerException { if (raf != null) { throw (new FMFileManagerException("file already open")); } reserveAccess(reason); try { file_access.aboutToOpen(); raf = new RandomAccessFile( linked_file, access_mode == FM_READ ? READ_ACCESS_MODE : WRITE_ACCESS_MODE); } catch (FileNotFoundException e) { int st = file_access.getStorageType(); boolean ok = false; // edge case here when switching one file from dnd -> download and the compact files at edge // boundaries not // yet allocated - attempt to create the file on demand try { linked_file.getParentFile().mkdirs(); linked_file.createNewFile(); raf = new RandomAccessFile( linked_file, access_mode == FM_READ ? READ_ACCESS_MODE : WRITE_ACCESS_MODE); ok = true; } catch (Throwable f) { } if (!ok) { Debug.printStackTrace(e); throw (new FMFileManagerException("open fails", e)); } } catch (Throwable e) { Debug.printStackTrace(e); throw (new FMFileManagerException("open fails", e)); } }