public static XMLBeanReader createHibernateConfigsReader(HibernatePlugin plugin) throws IOException, XMLException { XMLBeanReader reader = new XMLBeanReader(); FileWrapper pluginUserSettingsFolder = plugin.getPluginUserSettingsFolder(); FileWrapper xmlFile = getXmlFile(pluginUserSettingsFolder); if (false == xmlFile.exists()) { return null; } reader.load(xmlFile, plugin.getClass().getClassLoader()); return reader; }
/** * Load the stored bookmarks. */ protected void load() throws IOException { try { XMLBeanReader xmlin = new XMLBeanReader(); if (bookmarkFile.exists()) { xmlin.load(bookmarkFile, getClass().getClassLoader()); for (Iterator<?> i = xmlin.iterator(); i.hasNext();) { Object bean = i.next(); if (bean instanceof Bookmark) { add((Bookmark) bean); } } } } catch (XMLException e) { throw new RuntimeException(e); } }
FileWrapper boomarkPropsFile = fileWrapperFactory.create(usf, BOOKMARKS_PROPS_FILE); if(false == boomarkPropsFile.exists())
private void loadPrefs() { try { _newSessionPrefs = new CodeCompletionPreferences(); FileWrapper prefsFile = fileWrapperFactory.create(getPluginUserSettingsFolder(), PREFS_FILE_NAME); if(prefsFile.exists()) { XMLBeanReader reader = new XMLBeanReader(); reader.load(prefsFile, getClass().getClassLoader()); Iterator<?> it = reader.iterator(); if (it.hasNext()) { _newSessionPrefs = (CodeCompletionPreferences) it.next(); } } } catch (Exception e) { throw new RuntimeException(e); } }
public AutoCorrectData getAutoCorrectData() { try { if (null == _autoCorrectData) { XMLBeanReader br = new XMLBeanReader(); FileWrapper path = _fileWrapperFactory.create(_pluginUserSettingsFolder, AUTO_CORRECT_DATA_FILE_NAME); if (path.exists()) { br.load(path, this.getClass().getClassLoader()); _autoCorrectData = (AutoCorrectData) br.iterator().next(); } else { _autoCorrectData = getDefaultAutoCorrectData(); } } return _autoCorrectData; } catch (Exception e) { throw new RuntimeException(e); } }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#checkDir(FileWrapper, java.lang.String) */ public FileWrapper checkDir(FileWrapper parent, String child) { FileWrapper dir = _fileWrapperFactory.create(parent, child); if (!dir.exists() && !dir.mkdir()) { s_log.error("checkDir: Failed to mkdir - " + dir.getAbsolutePath()); } return dir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#checkDir(FileWrapper, java.lang.String) */ public FileWrapper checkDir(FileWrapper parent, String child) { FileWrapper dir = _fileWrapperFactory.create(parent, child); if (!dir.exists() && !dir.mkdir()) { s_log.error("checkDir: Failed to mkdir - " + dir.getAbsolutePath()); } return dir; }
if (!file.exists())
if (!file.exists())
try if (changeListFile.exists())
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil# * isPresentInDownloadsDirectory(net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus) */ public boolean isPresentInDownloadsDirectory(ArtifactStatus status) { boolean result = false; FileWrapper downloadFile = getDownloadFileLocation(status); if (downloadFile.exists()) { long checkSum = getCheckSum(downloadFile); if (status.getChecksum() == checkSum) { if (downloadFile.length() == status.getSize()) { result = true; } } } return result; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil# * isPresentInDownloadsDirectory(net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus) */ public boolean isPresentInDownloadsDirectory(ArtifactStatus status) { boolean result = false; FileWrapper downloadFile = getDownloadFileLocation(status); if (downloadFile.exists()) { long checkSum = getCheckSum(downloadFile); if (status.getChecksum() == checkSum) { if (downloadFile.length() == status.getSize()) { result = true; } } } return result; }
if (result.exists())
proxySettings); FileWrapper releaseXmlFile = _fileWrapperFactory.create(filename); if (releaseXmlFile.exists())
proxySettings); FileWrapper releaseXmlFile = _fileWrapperFactory.create(filename); if (releaseXmlFile.exists())
/** * @see net.sourceforge.squirrel_sql.plugins.dbdiff.IScriptFileManager#cleanupScriptFiles() */ public void cleanupScriptFiles() { for (final String scriptFile : scriptFiles) { final FileWrapper fileWrapper = fileWrapperFactory.create(scriptFile); if (fileWrapper.exists()) { if (s_log.isDebugEnabled()) { s_log.debug("Attempting to delete previously created temporary script file: " + scriptFile); } fileWrapper.delete(); } else { if (s_log.isDebugEnabled()) { s_log.debug("Previously created temporary script file did not exist: " + scriptFile); } } } }
fileWrapperFactory.create(plugin.getPluginAppSettingsFolder(), "skinlf-theme-packs"); _prefs.setThemePackDirectory(themePackDir.getAbsolutePath()); if (!themePackDir.exists())
if (fileToRemove.exists())
if (path.exists())