eclipse plugin: Remove duplicate method and use...

...one already existing
This commit is contained in:
Timotei Dolean 2011-07-06 16:53:53 +00:00
parent 20d2ba9b41
commit 2dd6b5647f

View file

@ -434,10 +434,10 @@ public class WorkspaceUtils
*/
public static boolean checkPathsAreSet( String installName, boolean displayWarning)
{
if ( !validPath( Preferences.getPaths( installName ).getWesnothExecutablePath( ) ) ||
!validPath( Preferences.getPaths( installName ).getUserDir( ) ) ||
!validPath( Preferences.getPaths( installName ).getWMLToolsDir( ) ) ||
!validPath( Preferences.getPaths( installName ).getWorkingDir( ) ))
if ( !ResourceUtils.isValidFilePath( Preferences.getPaths( installName ).getWesnothExecutablePath( ) ) ||
!ResourceUtils.isValidFilePath( Preferences.getPaths( installName ).getUserDir( ) ) ||
!ResourceUtils.isValidFilePath( Preferences.getPaths( installName ).getWMLToolsDir( ) ) ||
!ResourceUtils.isValidFilePath( Preferences.getPaths( installName ).getWorkingDir( ) ))
{
if (displayWarning)
GUIUtils.showWarnMessageBox(Messages.WorkspaceUtils_33);
@ -446,14 +446,4 @@ public class WorkspaceUtils
return true;
}
/**
* Checks if the path is valid and the specified path's resource exists
* @param path the path to check
* @return
*/
public static boolean validPath(String path)
{
return !path.isEmpty() && new File(path).exists();
}
}