|
@@ -26,6 +26,7 @@ import org.apache.hadoop.fs.FileSystemTestHelper;
|
|
|
import org.apache.hadoop.fs.FsConstants;
|
|
|
import org.apache.hadoop.fs.Path;
|
|
|
import org.apache.hadoop.fs.viewfs.ConfigUtil;
|
|
|
+import org.apache.hadoop.util.Shell;
|
|
|
import org.mortbay.log.Log;
|
|
|
|
|
|
|
|
@@ -123,8 +124,11 @@ public class ViewFileSystemTestSetup {
|
|
|
* in the target file system.
|
|
|
*/
|
|
|
static void linkUpFirstComponents(Configuration conf, String path, FileSystem fsTarget, String info) {
|
|
|
- int indexOf2ndSlash = path.indexOf('/', 1);
|
|
|
- String firstComponent = path.substring(0, indexOf2ndSlash);
|
|
|
+ int indexOfEnd = path.indexOf('/', 1);
|
|
|
+ if (Shell.WINDOWS) {
|
|
|
+ indexOfEnd = path.indexOf('/', indexOfEnd + 1);
|
|
|
+ }
|
|
|
+ String firstComponent = path.substring(0, indexOfEnd);
|
|
|
URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri();
|
|
|
ConfigUtil.addLink(conf, firstComponent, linkTarget);
|
|
|
Log.info("Added link for " + info + " "
|