private void verifyDirectory(FileWrapper fromDir, FileWrapper toDir) { if (!fromDir.isDirectory()) { throw new IllegalArgumentException("Expected fromDir(" + fromDir.getAbsolutePath() + ") to be a directory."); } if (!toDir.isDirectory()) { throw new IllegalArgumentException("Expected toDir(" + toDir.getAbsolutePath() + ") to be a directory."); } }
private void verifyDirectory(FileWrapper fromDir, FileWrapper toDir) { if (!fromDir.isDirectory()) { throw new IllegalArgumentException("Expected fromDir(" + fromDir.getAbsolutePath() + ") to be a directory."); } if (!toDir.isDirectory()) { throw new IllegalArgumentException("Expected toDir(" + toDir.getAbsolutePath() + ") to be a directory."); } }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelPluginsDir() */ public FileWrapper getSquirrelPluginsDir() { FileWrapper squirrelHomeDir = _appFileWrappers.getPluginsDirectory(); if (!squirrelHomeDir.isDirectory()) { s_log.error("SQuirreL Plugins Directory (" + squirrelHomeDir.getAbsolutePath() + " doesn't appear to be a directory"); } return squirrelHomeDir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelHomeDir() */ public FileWrapper getSquirrelHomeDir() { FileWrapper squirrelHomeDir = _appFileWrappers.getSquirrelHomeDir(); if (!squirrelHomeDir.isDirectory()) { s_log.error("SQuirreL Home Directory (" + squirrelHomeDir.getAbsolutePath() + " doesn't appear to be a directory"); } return squirrelHomeDir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelPluginsDir() */ public FileWrapper getSquirrelPluginsDir() { FileWrapper squirrelHomeDir = _appFileWrappers.getPluginsDirectory(); if (!squirrelHomeDir.isDirectory()) { s_log.error("SQuirreL Plugins Directory (" + squirrelHomeDir.getAbsolutePath() + " doesn't appear to be a directory"); } return squirrelHomeDir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelLibraryDir() */ public FileWrapper getSquirrelLibraryDir() { FileWrapper squirrelLibDir = _appFileWrappers.getLibraryDirectory(); if (!squirrelLibDir.isDirectory()) { s_log.error("SQuirreL Library Directory (" + squirrelLibDir.getAbsolutePath() + " doesn't appear to be a directory"); } return squirrelLibDir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelHomeDir() */ public FileWrapper getSquirrelHomeDir() { FileWrapper squirrelHomeDir = _appFileWrappers.getSquirrelHomeDir(); if (!squirrelHomeDir.isDirectory()) { s_log.error("SQuirreL Home Directory (" + squirrelHomeDir.getAbsolutePath() + " doesn't appear to be a directory"); } return squirrelHomeDir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelLibraryDir() */ public FileWrapper getSquirrelLibraryDir() { FileWrapper squirrelLibDir = _appFileWrappers.getLibraryDirectory(); if (!squirrelLibDir.isDirectory()) { s_log.error("SQuirreL Library Directory (" + squirrelLibDir.getAbsolutePath() + " doesn't appear to be a directory"); } return squirrelLibDir; }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#copyDir( * net.sourceforge.squirrel_sql.fw.util.FileWrapper, * java.lang.String, boolean, net.sourceforge.squirrel_sql.fw.util.FileWrapper) */ @Override public void moveFiles(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir) throws FileNotFoundException, IOException { if (StringUtils.isEmpty(filePattern)) { throw new IllegalArgumentException("filePattern arg cannot be empty or null"); } if (!fromDir.isDirectory()) { throw new IllegalArgumentException("Expected fromDir(" + fromDir.getAbsolutePath() + ") to be a directory."); } if (!toDir.isDirectory()) { throw new IllegalArgumentException("Expected toDir(" + toDir.getAbsolutePath() + ") to be a directory."); } List<FileWrapper> filesToMove = getFilterFileList(fromDir, filePattern, matchPattern); for (FileWrapper file : filesToMove) { copyFile(file, toDir); if (s_log.isDebugEnabled()) { s_log.debug("moveFiles: Attempting to delete file "+file.getAbsolutePath()); } if (file.delete()) { s_log.error("moveFiles: Unable to delete file "+file.getAbsolutePath()); } } }
/** * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#copyDir( * net.sourceforge.squirrel_sql.fw.util.FileWrapper, * java.lang.String, boolean, net.sourceforge.squirrel_sql.fw.util.FileWrapper) */ @Override public void moveFiles(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir) throws FileNotFoundException, IOException { if (StringUtils.isEmpty(filePattern)) { throw new IllegalArgumentException("filePattern arg cannot be empty or null"); } if (!fromDir.isDirectory()) { throw new IllegalArgumentException("Expected fromDir(" + fromDir.getAbsolutePath() + ") to be a directory."); } if (!toDir.isDirectory()) { throw new IllegalArgumentException("Expected toDir(" + toDir.getAbsolutePath() + ") to be a directory."); } List<FileWrapper> filesToMove = getFilterFileList(fromDir, filePattern, matchPattern); for (FileWrapper file : filesToMove) { copyFile(file, toDir); if (s_log.isDebugEnabled()) { s_log.debug("moveFiles: Attempting to delete file "+file.getAbsolutePath()); } if (file.delete()) { s_log.error("moveFiles: Unable to delete file "+file.getAbsolutePath()); } } }
if (!file.isDirectory())
/** * Loads the channel xml bean from the file system.throw new IOException(); * * @param path * the directory to find release.xml in * @return the ChannelXmlBean that represents the specified path. */ public ChannelXmlBean loadUpdateFromFileSystem(final String path) { ChannelXmlBean result = null; try { FileWrapper f = _fileWrapperFactory.create(path); if (!f.isDirectory()) { s_log.error("FileSystem path (" + path + ") is not a directory."); } else { f = _fileWrapperFactory.create(f, RELEASE_XML_FILENAME); result = _serializer.readChannelBean(f); } } catch (IOException e) { s_log.error("Unexpected exception while attempting " + "load updates from filesystem path (" + path + "): " + e.getMessage(), e); } return result; }
if (file.isDirectory())
if (!file.isDirectory())
/** * Loads the channel xml bean from the file system.throw new IOException(); * * @param path * the directory to find release.xml in * @return the ChannelXmlBean that represents the specified path. */ public ChannelXmlBean loadUpdateFromFileSystem(final String path) { ChannelXmlBean result = null; try { FileWrapper f = _fileWrapperFactory.create(path); if (!f.isDirectory()) { s_log.error("FileSystem path (" + path + ") is not a directory."); } else { f = _fileWrapperFactory.create(f, RELEASE_XML_FILENAME); result = _serializer.readChannelBean(f); } } catch (IOException e) { s_log.error("Unexpected exception while attempting " + "load updates from filesystem path (" + path + "): " + e.getMessage(), e); } return result; }
if (!result.isDirectory())
if (!result.isDirectory())