/** * Make the path fully qualified if it is isn't. * A Fully-qualified path has scheme and authority specified and an absolute * path. * Use the default file system and working dir in this FileContext to qualify. * @param path * @return qualified path */ public Path makeQualified(final Path path) { return path.makeQualified(defaultFS.getUri(), getWorkingDirectory()); }
public static String getAbsoluteTestRootDir(FileContext fc) throws IOException { if (absTestRootDir == null) { if (TEST_ROOT_DIR.startsWith("/")) { absTestRootDir = TEST_ROOT_DIR; } else { absTestRootDir = fc.getWorkingDirectory().toString() + "/" + TEST_ROOT_DIR; } } return absTestRootDir; }
/** * Make the path fully qualified if it is isn't. * A Fully-qualified path has scheme and authority specified and an absolute * path. * Use the default file system and working dir in this FileContext to qualify. * @param path * @return qualified path */ public Path makeQualified(final Path path) { return path.makeQualified(defaultFS.getUri(), getWorkingDirectory()); }
/** * Make the path fully qualified if it is isn't. * A Fully-qualified path has scheme and authority specified and an absolute * path. * Use the default file system and working dir in this FileContext to qualify. * @param path * @return qualified path */ public Path makeQualified(final Path path) { return path.makeQualified(defaultFS.getUri(), getWorkingDirectory()); }
/** * Make the path fully qualified if it is isn't. * A Fully-qualified path has scheme and authority specified and an absolute * path. * Use the default file system and working dir in this FileContext to qualify. * @param path * @return qualified path */ public Path makeQualified(final Path path) { return path.makeQualified(defaultFS.getUri(), getWorkingDirectory()); }
/** * Make the path fully qualified if it is isn't. * A Fully-qualified path has scheme and authority specified and an absolute * path. * Use the default file system and working dir in this FileContext to qualify. * @param path * @return qualified path */ public Path makeQualified(final Path path) { return path.makeQualified(defaultFS.getUri(), getWorkingDirectory()); }
@Override public Path getWorkingDirectory() { return fc.getWorkingDirectory(); }
protected Path getDefaultWorkingDirectory() throws IOException { return getTestRootPath(fc, "/user/" + System.getProperty("user.name")).makeQualified( fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
public static Path getDefaultWorkingDirectory(FileContext fc) throws IOException { return getTestRootPath(fc, "/user/" + System.getProperty("user.name")) .makeQualified(fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
@Test /** Test setWorkingDirectory not resolves symlinks */ public void testSetWDNotResolvesLinks() throws IOException { Path dir = new Path(testBaseDir1()); Path linkToDir = new Path(testBaseDir1()+"/link"); fc.createSymlink(dir, linkToDir, false); fc.setWorkingDirectory(linkToDir); assertEquals(linkToDir.getName(), fc.getWorkingDirectory().getName()); }
public String getAbsoluteTestRootDir(FileContext fc) { if (absTestRootDir == null) { if (new Path(testRootDir).isAbsolute()) { absTestRootDir = testRootDir; } else { absTestRootDir = fc.getWorkingDirectory().toString() + "/" + testRootDir; } } return absTestRootDir; }
public String getAbsoluteTestRootDir(FileContext fc) { if (absTestRootDir == null) { if (new Path(testRootDir).isAbsolute()) { absTestRootDir = testRootDir; } else { absTestRootDir = fc.getWorkingDirectory().toString() + "/" + testRootDir; } } return absTestRootDir; }
public Path getDefaultWorkingDirectory() throws IOException { return getTestRootPath("/user/" + System.getProperty("user.name")) .makeQualified(fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
protected Path getDefaultWorkingDirectory() throws IOException { return getTestRootPath(fc, "/user/" + System.getProperty("user.name")).makeQualified( fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
public Path getDefaultWorkingDirectory() throws IOException { return getTestRootPath("/user/" + System.getProperty("user.name")) .makeQualified(fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
public Path getDefaultWorkingDirectory(FileContext fc) { return getTestRootPath(fc, "/user/" + System.getProperty("user.name")) .makeQualified(fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
protected Path getDefaultWorkingDirectory() throws IOException { return getTestRootPath(fc, "/user/" + System.getProperty("user.name")).makeQualified( fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
public Path getDefaultWorkingDirectory(FileContext fc) { return getTestRootPath(fc, "/user/" + System.getProperty("user.name")) .makeQualified(fc.getDefaultFileSystem().getUri(), fc.getWorkingDirectory()); }
@Test public void testBasicPaths() { Assert.assertEquals(FsConstants.VIEWFS_URI, fcView.getDefaultFileSystem().getUri()); Assert.assertEquals(fcView.makeQualified( new Path("/user/" + System.getProperty("user.name"))), fcView.getWorkingDirectory()); Assert.assertEquals(fcView.makeQualified( new Path("/user/" + System.getProperty("user.name"))), fcView.getHomeDirectory()); Assert.assertEquals( new Path("/foo/bar").makeQualified(FsConstants.VIEWFS_URI, null), fcView.makeQualified(new Path("/foo/bar"))); }
@Test public void testBasicPaths() { Assert.assertEquals(FsConstants.VIEWFS_URI, fcView.getDefaultFileSystem().getUri()); Assert.assertEquals(fcView.makeQualified( new Path("/user/" + System.getProperty("user.name"))), fcView.getWorkingDirectory()); Assert.assertEquals(fcView.makeQualified( new Path("/user/" + System.getProperty("user.name"))), fcView.getHomeDirectory()); Assert.assertEquals( new Path("/foo/bar").makeQualified(FsConstants.VIEWFS_URI, null), fcView.makeQualified(new Path("/foo/bar"))); }