Author: nbelaevski
Date: 2010-04-06 12:21:28 -0400 (Tue, 06 Apr 2010)
New Revision: 16738
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java
Log:
Fixed ui-core build problem on windows
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java 2010-04-06
16:09:36 UTC (rev 16737)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java 2010-04-06
16:21:28 UTC (rev 16738)
@@ -31,15 +31,15 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class SourceFileManager implements FileManager {
private final Iterable<File> sources;
private final Iterable<File> folders;
-
+
public SourceFileManager(Iterable<File> sources, Iterable<File> folders)
{
this.sources = sources;
this.folders = folders;
@@ -47,7 +47,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.FileManager#createFile(java.lang.String)
*/
@Override
@@ -57,15 +57,23 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.FileManager#getFile(java.lang.String)
*/
@Override
public File getFile(String path) throws FileNotFoundException {
+ String platformPath;
+
+ if (File.separatorChar == '/') {
+ platformPath = path;
+ } else {
+ platformPath = path.replace('/', File.separatorChar);
+ }
+
if (null != folders) {
for (File folder : folders) {
if (folder.exists() && folder.isDirectory()) {
- File configFile = new File(folder, path);
+ File configFile = new File(folder, platformPath);
if (configFile.exists()) {
return configFile;
}
@@ -74,7 +82,7 @@
}
if(null != sources){
for (File file : sources) {
- if(file.getAbsolutePath().endsWith(path)){
+ if(file.getAbsolutePath().endsWith(platformPath)){
return file;
}
}
@@ -84,7 +92,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.FileManager#getFiles()
*/
@Override
Show replies by date