// filter out dirs the user doesn't have permission write to.
ArrayList<String> filtered = new ArrayList<String>();
if (runtimePath != null){
for (String path : runtimePath){
if (new File(path).canWrite()){
if (Installer.isUninstall()){
File eclimDir = new File(path + "/eclim");
if (eclimDir.exists()){
if (eclimDir.canWrite()){
filtered.add(path);
}else{
logger.warn(
path + "/eclim is not writable by the current user");
}
}
}else{
filtered.add(path);
}
}
}
}
String[] rtp = filtered.toArray(new String[filtered.size()]);
if(rtp == null || rtp.length == 0){
if(!Installer.isUninstall()){
if(!homeVimCreatePrompted){
createUserVimFiles("No suitable vim files directory found.");
}else{
GuiDialogs.showWarning(
"Your vim install is still reporting no\n" +
"suitable vim files directories.\n" +
"You will need to manually specify one.");
}
}
}else{
if(rtp.length == 1){
fileChooser.getTextField().setText(rtp[0]);
// try to discourage windows users from installing eclim files in
// their vim installation.
if(new File(rtp[0] + "/gvim.exe").exists()){
createUserVimFiles("No user vim files directory found.");
}
}else{
dirList = new JList(rtp);
dirList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);