Lines 42-52
Link Here
|
42 |
package org.netbeans.modules.php.nette2; |
42 |
package org.netbeans.modules.php.nette2; |
43 |
|
43 |
|
44 |
import java.io.File; |
44 |
import java.io.File; |
|
|
45 |
import java.io.IOException; |
45 |
import java.util.ArrayList; |
46 |
import java.util.ArrayList; |
46 |
import java.util.Arrays; |
47 |
import java.util.Arrays; |
47 |
import java.util.Collections; |
48 |
import java.util.Collections; |
48 |
import java.util.List; |
49 |
import java.util.List; |
49 |
import java.util.Set; |
50 |
import java.util.Set; |
|
|
51 |
import java.util.logging.Level; |
52 |
import java.util.logging.Logger; |
50 |
import org.netbeans.modules.php.api.framework.BadgeIcon; |
53 |
import org.netbeans.modules.php.api.framework.BadgeIcon; |
51 |
import org.netbeans.modules.php.api.phpmodule.PhpModule; |
54 |
import org.netbeans.modules.php.api.phpmodule.PhpModule; |
52 |
import org.netbeans.modules.php.api.phpmodule.PhpModuleProperties; |
55 |
import org.netbeans.modules.php.api.phpmodule.PhpModuleProperties; |
Lines 97-105
Link Here
|
97 |
if (!result) { |
100 |
if (!result) { |
98 |
FileObject sourceDirectory = phpModule.getSourceDirectory(); |
101 |
FileObject sourceDirectory = phpModule.getSourceDirectory(); |
99 |
if (sourceDirectory != null) { |
102 |
if (sourceDirectory != null) { |
100 |
FileObject bootstrap = sourceDirectory.getFileObject(Constants.COMMON_BOOTSTRAP_PATH); |
103 |
FileObject bootstrap = getFileObject(sourceDirectory, Constants.COMMON_BOOTSTRAP_PATH); |
101 |
result = bootstrap != null && !bootstrap.isFolder() && bootstrap.isValid(); |
104 |
result = bootstrap != null && !bootstrap.isFolder() && bootstrap.isValid(); |
102 |
FileObject config = sourceDirectory.getFileObject(Constants.COMMON_CONFIG_PATH); |
105 |
FileObject config = getFileObject(sourceDirectory, Constants.COMMON_CONFIG_PATH); |
103 |
result = result && config != null && config.isFolder() && config.isValid(); |
106 |
result = result && config != null && config.isFolder() && config.isValid(); |
104 |
} |
107 |
} |
105 |
} |
108 |
} |
Lines 181-184
Link Here
|
181 |
return new Nette2CustomizerExtender(phpModule); |
184 |
return new Nette2CustomizerExtender(phpModule); |
182 |
} |
185 |
} |
183 |
|
186 |
|
|
|
187 |
/** |
188 |
* Try to get a FileObject with correct filename case. See bug 238679. |
189 |
* |
190 |
* @param parent Parent FileObject. |
191 |
* @param relPath Relative path, separated by slashes. |
192 |
*/ |
193 |
private FileObject getFileObject(FileObject parent, String relPath) { |
194 |
File parentFile = FileUtil.toFile(parent); |
195 |
if (parentFile != null) { |
196 |
String nativePath = relPath.replace('/', File.separatorChar); |
197 |
try { |
198 |
File retFile = new File(parentFile, nativePath).getCanonicalFile(); |
199 |
return FileUtil.toFileObject(retFile); |
200 |
} catch (IOException ex) { |
201 |
Logger.getLogger(Nette2FrameworkProvider.class.getName()).log( |
202 |
Level.FINE, null, ex); |
203 |
return null; |
204 |
} |
205 |
} else { |
206 |
return null; |
207 |
} |
208 |
} |
184 |
} |
209 |
} |