{"action":"created","comment":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/comments/22757863","id":22757863,"diff_hunk":"@@ -0,0 +1,821 @@\n+/**\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with\n+ * the License. You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on\n+ * an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations under the License.\n+ *\n+ * Copyright 2012-2014 the original author or authors.\n+ */\n+package org.assertj.core.api;\n+\n+import org.assertj.core.internal.Paths;\n+import org.assertj.core.util.PathsException;\n+import org.assertj.core.util.VisibleForTesting;\n+\n+import java.nio.file.ClosedFileSystemException;\n+import java.nio.file.FileSystem;\n+import java.nio.file.FileSystems;\n+import java.nio.file.Files;\n+import java.nio.file.LinkOption;\n+import java.nio.file.Path;\n+import java.nio.file.ProviderMismatchException;\n+import java.nio.file.spi.FileSystemProvider;\n+\n+/**\n+ * Assertions for {@link Path} objects\n+ *\n+ * <p>Note that some assertions have two versions: a normal one and a \"raw\" one\n+ * (for instance, {@code hasParent()} and {@code hasParentRaw()}. The difference\n+ * is that normal assertions will {@link Path#toRealPath(LinkOption...)\n+ * canonicalize} or {@link Path#normalize() normalize} the tested path and,\n+ * where applicable, the path argument, before performing the actual test.\n+ * Canonicalization includes normalization.</p>\n+ *\n+ * <p>Canonicalization may lead to an I/O error if a path does not exist, in\n+ * which case the given assertions will fail with a {@link PathsException}. Also\n+ * note that {@link Files#isSymbolicLink(Path) symbolic links} will be followed\n+ * if the filesystem supports them. Finally, if a path is not {@link\n+ * Path#isAbsolute()} absolute}, canonicalization will resolve the path against\n+ * the process' current working directory.</p>\n+ *\n+ * <p>These assertions are filesystem independent. You may use them on {@code\n+ * Path} instances issued from the default filesystem (ie, instances you get\n+ * when using {@link java.nio.file.Paths#get(String, String...)}) or from other\n+ * filesystems. For more information, see the {@link FileSystem javadoc for\n+ * {@code FileSystem}}.</p>\n+ *\n+ * <p>Furthermore:</p>\n+ *\n+ * <ul>\n+ *     <li>Unless otherwise noted, assertions which accept arguments will not\n+ *     accept {@code null} arguments; if a null argument is passed, these\n+ *     assertions will throw a {@link NullPointerException}.</li>\n+ *     <li>It is the caller's responsibility to ensure that paths used in\n+ *     assertions are issued from valid filesystems which are not {@link\n+ *     FileSystem#close() closed}. If a filesystems is closed, assertions will\n+ *     throw a {@link ClosedFileSystemException}.</li>\n+ *     <li>Some assertions take another {@link Path} as an argument. If this\n+ *     path is not issued from the same {@link FileSystemProvider provider} as\n+ *     the tested path, assertions will throw a {@link\n+ *     ProviderMismatchException}.</li>\n+ *     <li>Some assertions may need to perform I/O on the path's underlying\n+ *     filesystem; if an I/O error occurs when accessing the filesystem, these\n+ *     assertions will throw a {@link PathsException}.</li>\n+ * </ul>\n+ *\n+ * @param <S> self type\n+ *\n+ * @see Path\n+ * @see java.nio.file.Paths#get(String, String...)\n+ * @see FileSystem\n+ * @see FileSystem#getPath(String, String...)\n+ * @see FileSystems#getDefault()\n+ * @see Files\n+ */\n+public abstract class AbstractPathAssert<S extends AbstractPathAssert<S>>\n+    extends AbstractAssert<S, Path>\n+{\n+    @VisibleForTesting\n+    protected Paths paths = Paths.instance();\n+\n+    protected AbstractPathAssert(final Path actual, final Class<?> selfType)\n+    {\n+        super(actual, selfType);\n+    }\n+\n+    /**\n+     * Assert that a given path exists\n+     *\n+     * <p><strong>Note that this assertion will follow symbolic links before\n+     * asserting the path's existence.</strong></p>\n+     *\n+     * <p>On Windows system, this has no influence. On Unix systems, this means\n+     * the assertion result will fail if the path is a symbolic link whose\n+     * target does not exist. If you want to assert the existence of the\n+     * symbolic link itself, use {@link #existsNoFollow()} instead.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * // Create a symbolic link whose target does not exist\n+     * final Path nonExistent = fs.getPath(\"nonexistent\");\n+     * final Path dangling = fs.getPath(\"dangling\");\n+     * Files.createSymbolicLink(dangling, nonExistent);\n+     *\n+     * // Create a regular file, and a symbolic link pointing to it\n+     * final Path someFile = fs.getPath(\"somefile\");\n+     * Files.createFile(someFile);\n+     * final Path symlink = fs.getPath(\"symlink\");\n+     * Files.createSymbolicLink(symlink, someFile);\n+     *\n+     * // The following assertion succeeds\n+     * assertThat(symlink).exists();\n+     *\n+     * // The following assertion fails\n+     * assertThat(dangling).exists();\n+     * </code></pre>\n+     *\n+     * @return self\n+     *\n+     * @see Files#exists(Path, LinkOption...)\n+     */\n+    public S exists()\n+    {\n+        paths.assertExists(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given path exists, not following symbolic links\n+     *\n+     * <p>This assertion behaves like {@link #exists()}, with the difference\n+     * that it can be used to assert the existence of a symbolic link even if\n+     * its target is invalid.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * // Create a symbolic link whose target does not exist\n+     * final Path nonExistent = fs.getPath(\"nonexistent\");\n+     * final Path dangling = fs.getPath(\"dangling\");\n+     * Files.createSymbolicLink(dangling, nonExistent);\n+     *\n+     * // The following assertions succeed\n+     * assertThat(symlink).existsNoFollow();\n+     * assertThat(dangling).existsNoFollow();\n+     * </code></pre>\n+     *\n+     * @return self\n+     *\n+     * @see Files#exists(Path, LinkOption...)\n+     */\n+    public S existsNoFollow()\n+    {\n+        paths.assertExistsNoFollow(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given path does not exist\n+     *\n+     * <p><strong>IMPORTANT NOTE:</strong> this method will NOT follow symbolic\n+     * links (provided that the underlying {@link FileSystem} of this path\n+     * supports symbolic links at all).</p>\n+     *\n+     * <p>This means that even if the path to test is a symbolic link whose\n+     * target does not exist, this assertion will consider that the path exists\n+     * (note that this is unlike the default behavior of {@link #exists()}).</p>\n+     *\n+     * <p>If you are a Windows user, the above does not apply to you; if you are\n+     * a Unix user however, this is important. Consider the following:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a FileSystem\n+     * // Create a symbolic link \"foo\" whose nonexistent target is \"bar\"\n+     * final Path foo = fs.getPath(\"foo\");\n+     * final Path bar = fs.getPath(\"bar\");\n+     * Files.createSymbolicLink(foo, bar);\n+     *\n+     * // The following assertion fails:\n+     * assertThat(foo).doesNotExist();\n+     * </code></pre>\n+     *\n+     * @return self\n+     *\n+     * @see Files#notExists(Path, LinkOption...)\n+     * @see LinkOption#NOFOLLOW_LINKS\n+     */\n+    public S doesNotExist()\n+    {\n+        paths.assertNotExists(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given path is a regular file\n+     *\n+     * <p><strong>Note that this method will follow symbolic links.</strong> If\n+     * you are a Unix user and wish to assert that a path is a symbolic link\n+     * instead, use {@link #isSymbolicLink()}.</p>\n+     *\n+     * <p>This assertion first asserts the existence of the path (using {@link\n+     * #exists()}) then checks whether the path is a regular file.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     *\n+     * // Create a regular file, and a symbolic link to that regular file\n+     * final Path regularFile = fs.getPath(\"regularFile\");\n+     * final Path symlink = fs.getPath(\"symlink\");\n+     * Files.createFile(regularFile);\n+     * Files.createSymbolicLink(symlink, regularFile);\n+     *\n+     * // Create a directory, and a symbolic link to that directory\n+     * final Path dir = fs.getPath(\"dir\");\n+     * final Path dirSymlink = fs.getPath(\"dirSymlink\");\n+     * Files.createDirectories(dir);\n+     * Files.createSymbolicLink(dirSymlink, dir);\n+     *\n+     * // Create a nonexistent entry, and a symbolic link to that entry\n+     * final Path nonExistent = fs.getPath(\"nonexistent\");\n+     * final Path dangling = fs.getPath(\"dangling\");\n+     * Files.createSymbolicLink(dangling, nonExistent);\n+     *\n+     * // the following assertions fail because paths do not exist:\n+     * assertThat(nonExistent).isRegularFile();\n+     * assertThat(dangling).isRegularFile();\n+     *\n+     * // the following assertions fail because paths exist but are not regular\n+     * // files:\n+     * assertThat(dir).isRegularFile();\n+     * assertThat(dirSymlink).isRegularFile();\n+     *\n+     * // the following assertions succeed:\n+     * assertThat(regularFile).isRegularFile();\n+     * assertThat(symlink).isRegularFile();\n+     * </code></pre>\n+     *\n+     * @return self\n+     */\n+    public S isRegularFile()\n+    {\n+        paths.assertIsRegularFile(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given path is a directory\n+     *\n+     * <p><strong>Note that this method will follow symbolic links.</strong> If\n+     * you are a Unix user and wish to assert that a path is a symbolic link\n+     * instead, use {@link #isSymbolicLink()}.</p>\n+     *\n+     * <p>This assertion first asserts the existence of the path (using {@link\n+     * #exists()}) then checks whether the path is a directory.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     *\n+     * // Create a regular file, and a symbolic link to that regular file\n+     * final Path regularFile = fs.getPath(\"regularFile\");\n+     * final Path symlink = fs.getPath(\"symlink\");\n+     * Files.createFile(regularFile);\n+     * Files.createSymbolicLink(symlink, regularFile);\n+     *\n+     * // Create a directory, and a symbolic link to that directory\n+     * final Path dir = fs.getPath(\"dir\");\n+     * final Path dirSymlink = fs.getPath(\"dirSymlink\");\n+     * Files.createDirectories(dir);\n+     * Files.createSymbolicLink(dirSymlink, dir);\n+     *\n+     * // Create a nonexistent entry, and a symbolic link to that entry\n+     * final Path nonExistent = fs.getPath(\"nonexistent\");\n+     * final Path dangling = fs.getPath(\"dangling\");\n+     * Files.createSymbolicLink(dangling, nonExistent);\n+     *\n+     * // the following assertions fail because paths do not exist:\n+     * assertThat(nonExistent).isRegularFile();\n+     * assertThat(dangling).isRegularFile();\n+     *\n+     * // the following assertions fail because paths exist but are not\n+     * // directories:\n+     * assertThat(regularFile).isRegularFile();\n+     * assertThat(symlink).isRegularFile();\n+     *\n+     * // the following assertions succeed:\n+     * assertThat(dir).isRegularFile();\n+     * assertThat(dirSymlink).isRegularFile();\n+     * </code></pre>\n+     *\n+     * @return self\n+     */\n+    public S isDirectory()\n+    {\n+        paths.assertIsDirectory(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given path is a symbolic link\n+     *\n+     * <p>This assertion first asserts the existence of the path (using {@link\n+     * #existsNoFollow()}) then checks whether the path is a symbolic link.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     *\n+     * // Create a regular file, and a symbolic link to that regular file\n+     * final Path regularFile = fs.getPath(\"regularFile\");\n+     * final Path symlink = fs.getPath(\"symlink\");\n+     * Files.createFile(regularFile);\n+     * Files.createSymbolicLink(symlink, regularFile);\n+     *\n+     * // Create a directory, and a symbolic link to that directory\n+     * final Path dir = fs.getPath(\"dir\");\n+     * final Path dirSymlink = fs.getPath(\"dirSymlink\");\n+     * Files.createDirectories(dir);\n+     * Files.createSymbolicLink(dirSymlink, dir);\n+     *\n+     * // Create a nonexistent entry, and a symbolic link to that entry\n+     * final Path nonExistent = fs.getPath(\"nonexistent\");\n+     * final Path dangling = fs.getPath(\"dangling\");\n+     * Files.createSymbolicLink(dangling, nonExistent);\n+     *\n+     * // the following assertion fails because the path does not exist:\n+     * assertThat(nonExistent).isSymbolicLink();\n+     *\n+     * // the following assertions fail because paths exist but are not symbolic\n+     * // links\n+     * assertThat(regularFile).isSymbolicLink();\n+     * assertThat(dirSymlink).isSymbolicLink();\n+     *\n+     * // the following assertions succeed:\n+     * assertThat(symlink).isSymbolicLink();\n+     * assertThat(dangling).isSymbolicLink();\n+     * assertThat(dir).isSymbolicLink();\n+     * </code></pre>\n+     *\n+     * @return self\n+     */\n+    public S isSymbolicLink()\n+    {\n+        paths.assertIsSymbolicLink(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given path is absolute\n+     *\n+     * <p>Note that the fact that a path is absolute does not mean that it is\n+     * {@link Path#normalize() normalized}: {@code /foo/..} is absolute, for\n+     * instance, but it is not normalized.</p>\n+     *\n+     * <p>Sample use:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // unixFs is a Unix FileSystem\n+     * final Path path1 = unixFs.getPath(\"/foo/bar\");\n+     * final Path path2 = unixFs.getPath(\"foo/bar\");\n+     *\n+     * // The following assertion succeeds:\n+     * assertThat(path1).isAbsolute();\n+     *\n+     * // The following assertion fails:\n+     * assertThat(path2).isAbsolute();\n+     *\n+     * // windowsFs is a Windows FileSystem\n+     * final Path path3 = windowsFs.getPath(\"c:\\\\foo\");\n+     * final Path path4 = windowsFs.getPath(\"foo\\\\bar\");\n+     * final Path path5 = windowsFs.getPath(\"c:foo\");\n+     * final Path path6 = windowsFs.getPath(\"\\\\foo\\\\bar\");\n+     *\n+     * // The following assertion succeeds:\n+     * assertThat(path3).isAbsolute();\n+     *\n+     * // The following assertion fails...\n+     * assertThat(path4).isAbsolute();\n+     *\n+     * // ... And these one also fail!\n+     * assertThat(path5).isAbsolute();\n+     * assertThat(path6).isAbsolute();\n+     * </code></pre>\n+     *\n+     * @return self\n+     *\n+     * @see Path#isAbsolute()\n+     * @see Path#toRealPath(LinkOption...)\n+     */\n+    public S isAbsolute()\n+    {\n+        paths.assertIsAbsolute(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert that a given {@link Path} is normalized\n+     *\n+     * <p>A path is normalized if it has no redundant components; typically, on\n+     * both Unix and Windows, this means that the path has no \"self\" components\n+     * ({@code .}) and that its only parent components ({@code ..}), if any, are\n+     * at the beginning of the path.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * final Path normalized1 = fs.getPath(\"/usr/lib\");\n+     * final Path normalized2 = fs.getPath(\"/../../e\");\n+     * final Path normalized3 = fs.getPath(\"a/b/c\");\n+     * final Path normalized4 = fs.getPath(\"../d\");\n+     * final Path notNormalized1 = fs.getPath(\"/a/./b\");\n+     * final Path notNormalized2 = fs.getPath(\"c/..\");\n+     *\n+     * // the following assertions succeed:\n+     * assertThat(normalized1).isNormalized();\n+     * assertThat(normalized2).isNormalized();\n+     * assertThat(normalized3).isNormalized();\n+     * assertThat(normalized4).isNormalized();\n+     *\n+     * // the following assertions fail:\n+     * assertThat(notNormalized1).isNormalized();\n+     * assertThat(notNormalized2).isNormalized();\n+     * </code></pre>\n+     *\n+     * @return self\n+     */\n+    public S isNormalized()\n+    {\n+        paths.assertIsNormalized(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert whether the tested path is canonical\n+     *\n+     * <p>For Windows users, this assertion is no different than {@link\n+     * #isAbsolute()}. For Unix users, this assertion ensures that the tested\n+     * path is the actual file system resource, that is, it is not a {@link\n+     * Files#isSymbolicLink(Path) symbolic link} to the actual resource, even if\n+     * the path is absolute.</p>\n+     *\n+     * <p>Example:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * // Create a directory\n+     * final Path basedir = fs.getPath(\"/tmp/foo\");\n+     * Files.createDirectories(basedir);\n+     * // Create a file in this directory\n+     * final Path file = basedir.resolve(\"file\");\n+     * Files.createFile(file);\n+     * // Create a symbolic link to that file\n+     * final Path symlink = basedir.resolve(\"symlink\");\n+     * Files.createSymbolicLink(symlink, file);\n+     *\n+     * // The following assertion succeeds\n+     * assertThat(file).isCanonical();\n+     *\n+     * // The following assertion fails\n+     * assertThat(symlink).isCanonical();\n+     * </code></pre>\n+     *\n+     * @throws PathsException an I/O error occurred while evaluating the path\n+     *\n+     * @see Path#toRealPath(LinkOption...)\n+     * @see Files#isSameFile(Path, Path)\n+     */\n+    public S isCanonical()\n+    {\n+        paths.assertIsCanonical(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert whether the tested path has the expected parent path\n+     *\n+     * <p><em>This assertion will perform canonicalization of the tested path\n+     * and of the given argument before performing the test; see the class\n+     * description for more details. If this is not what you want, use {@link\n+     * #hasParentRaw(Path)} instead.</em></p>\n+     *\n+     * <p>Checks that the tested path has the given parent. This assertion will\n+     * fail both if the tested path has no parent, or has a different parent\n+     * than what is expected.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * final Path actual = fs.getPath(\"/dir1/dir2/file\");\n+     * // this path will be normalized to \"/dir1/dir2\"\n+     * final Path good = fs.getPath(\"/dir1/dir3/../dir2/.\");\n+     * final Path bad = fs.getPath(\"/dir1\");\n+     *\n+     * // the following assertion succeeds\n+     * assertThat(actual).hasParent(good);\n+     *\n+     * // the following assertion fails\n+     * assertThat(actual).hasParent(bad);\n+     * </code></pre>\n+     *\n+     * @param expected the expected parent path\n+     * @return self\n+     *\n+     * @see Path#getParent()\n+     */\n+    public S hasParent(final Path expected)\n+    {\n+        paths.assertHasParent(info, actual, expected);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert whether the tested path has the expected parent path\n+     *\n+     * <p><em>This assertion will not perform any canonicalization of either the\n+     * tested path or the path given as an argument; see class description for\n+     * more details. If this is not what you want, use {@link #hasParent(Path)}\n+     * instead.</em></p>\n+     *\n+     * <p>This assertion uses {@link Path#getParent()} with no modification,\n+     * which means the only criterion for this assertion's success is the path's\n+     * components (its root and its name elements).</p>\n+     *\n+     * <p>This may lead to surprising results if the tested path and the path\n+     * given as an argument are not normalized. For instance, if the tested\n+     * path is {@code /home/foo/../bar} and the argument is {@code /home}, the\n+     * assertion will <em>fail</em> since the parent of the tested path is not\n+     * {@code /home} but... {@code /home/foo/..}.</p>\n+     *\n+     * <p>While this may seem counterintuitive, it has to be recalled here that\n+     * it is not required for a {@link FileSystem} to consider that {@code .}\n+     * and {@code ..} are name elements for respectively the current directory\n+     * and the parent directory respectively. In fact, it is not even required\n+     * that a {@link FileSystem} be hierarchical at all.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * final Path actual = fs.getPath(\"/dir1/dir2/file\");\n+     * final Path good = fs.getPath(\"/dir1/dir2\");\n+     * final Path bad = fs.getPath(\"/dir1/dir3/../dir2\");\n+     *\n+     * // the following assertion succeeds\n+     * assertThat(actual).hasParentRaw(good);\n+     *\n+     * // the following assertion fails\n+     * assertThat(actual).hasParentRaw(bad);\n+     * </code></pre>\n+     *\n+     * @param expected the expected parent path\n+     * @return self\n+     *\n+     * @see Path#getParent()\n+     */\n+    public S hasParentRaw(final Path expected)\n+    {\n+        paths.assertHasParentRaw(info, actual, expected);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert whether the tested path has no parent\n+     *\n+     * <p><em>This assertion will first canonicalize the tested path before\n+     * performing the test; if this is not what you want, use {@link\n+     * #hasNoParentRaw()} instead.</em></p>\n+     *\n+     * <p>Check that the tested path, after canonicalization, has no parent. See\n+     * the class description for more information about canonicalization.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // unixFs is a Unix filesystem\n+     * final Path path1 = fs.getPath(\"/usr\");\n+     * // this path will be normalized to \"/\"\n+     * final Path path2 = fs.getPath(\"/foo/..\");\n+     * final Path path3 = fs.getPath(\"/usr/lib\");\n+     *\n+     * // the following assertions succeed\n+     * assertThat(path1).hasNoParent();\n+     * assertThat(path2).hasNoParent();\n+     *\n+     * // the following assertion fails\n+     * assertThat(path3).hasNoParent();\n+     * </code></pre>\n+     *\n+     * @return self\n+     *\n+     * @throws PathsException failed to canonicalize the tested path\n+     *\n+     * @see Path#getParent()\n+     */\n+    public S hasNoParent()\n+    {\n+        paths.assertHasNoParent(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Assert whether the tested path has no parent\n+     *\n+     * <p><em>This assertion will not canonicalize the tested path before\n+     * performing the test; if this is not what you want, use {@link\n+     * #hasNoParent()} instead.</em></p>\n+     *\n+     * <p>As canonicalization is not performed, this means the only criterion\n+     * for this assertion's success is the path's components (its root and its\n+     * name elements).</p>\n+     *\n+     * <p>This may lead to surprising results. For instance, path {@code\n+     * /usr/..} <em>does</em> have a parent, and this parent is {@code /usr}.\n+     * </p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // unixFs is a Unix filesystem\n+     * final Path path1 = fs.getPath(\"/usr\");\n+     * final Path path2 = fs.getPath(\"/\");\n+     * final Path path3 = fs.getPath(\"foo\");\n+     * final Path path4 = fs.getPath(\"/usr/lib\");\n+     *\n+     * // the following assertions succeed\n+     * assertThat(path1).hasNoParentRaw();\n+     * assertThat(path2).hasNoParentRaw();\n+     * assertThat(path3).hasNoParentRaw();\n+     *\n+     * // the following assertion fails\n+     * assertThat(path4).hasNoParentRaw();\n+     * </code></pre>\n+     *\n+     * @return self\n+     *\n+     * @see Path#getParent()\n+     */\n+    public S hasNoParentRaw()\n+    {\n+        paths.assertHasNoParentRaw(info, actual);\n+        return myself;\n+    }\n+\n+    /**\n+     * Check whether this path starts with another path\n+     *\n+     * <p><em>This assertion will perform canonicalization of both the tested\n+     * path and the path given as an argument; see class description for more\n+     * details. If this is not what you want, use {@link #startsWithRaw(Path)}\n+     * instead.</em></p>\n+     *\n+     * <p>Checks whether the tested path starts with another path. Note that the\n+     * name components matter, not the string representation; this means that,\n+     * for example, {@code /home/foobar/baz} <em>does not</em> start with {@code\n+     * /home/foo}.</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * final Path tested = fs.getPath(\"/home/joe/myfile\");\n+     * // this path will be canonicalized to \"/home/joe\"\n+     * final Path good = fs.getPath(\"/home/jane/../joe/.\");\n+     * final Path bad = fs.getPath(\"/home/harry\");\n+     *\n+     * // the following assertion succeeds:\n+     * assertThat(tested).startsWith(good);\n+     *\n+     * // the following assertion fails:\n+     * assertThat(tested).startsWith(bad);\n+     * </code></pre>\n+     *\n+     * @param other the other path\n+     * @return self\n+     *\n+     * @throws PathsException failed to canonicalize the tested path or the path\n+     * given as an argument\n+     *\n+     * @see Path#startsWith(Path)\n+     */\n+    public S startsWith(final Path other)\n+    {\n+        paths.assertStartsWith(info, actual, other);\n+        return myself;\n+    }\n+\n+    /**\n+     * Check whether this path starts with another path\n+     *\n+     * <p><em>This assertions does not perform canonicalization on either the\n+     * tested path or the path given as an argument; see class description for\n+     * more details. If this is not what you want, use {@link #startsWith(Path)}\n+     * instead.</em></p>\n+     *\n+     * <p>Checks whether the tested path starts with another path, without\n+     * performing canonicalization on its arguments. This means that the only\n+     * criterion to determine whether a path starts with another is the tested\n+     * path's, and the argument's, name elements.</p>\n+     *\n+     * <p>This may lead to some surprising results: for instance, path {@code\n+     * /../home/foo} does <em>not</em> start with {@code /home} since the first\n+     * name element of the former ({@code ..}) is different from the first name\n+     * element of the latter ({@code home}).</p>\n+     *\n+     * <p>Examples:</p>\n+     *\n+     * <pre><code class=\"java\">\n+     * // fs is a Unix filesystem\n+     * final Path tested = fs.getPath(\"/home/joe/myfile\");\n+     * final Path good = fs.getPath(\"/home/joe\");\n+     * final Path bad = fs.getPath(\"/home/../joe\");\n+     *\n+     * // the following assertion succeeds:\n+     * assertThat(tested).startsWithRaw(good);","path":"src/main/java/org/assertj/core/api/AbstractPathAssert.java","position":726,"original_position":726,"commit_id":"91c1d2a968d10fbc6c2a5e2965cc6b0cc3568415","original_commit_id":"91c1d2a968d10fbc6c2a5e2965cc6b0cc3568415","user":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars.githubusercontent.com/u/382613?v=3","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"body":"add: assertThat(tested).startsWithRaw(home);","created_at":"2015-01-10T09:47:16Z","updated_at":"2015-01-10T09:47:16Z","html_url":"https://github.com/joel-costigliola/assertj-core/pull/303#discussion_r22757863","pull_request_url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303","_links":{"self":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/comments/22757863"},"html":{"href":"https://github.com/joel-costigliola/assertj-core/pull/303#discussion_r22757863"},"pull_request":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303"}}},"pull_request":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303","id":26440491,"html_url":"https://github.com/joel-costigliola/assertj-core/pull/303","diff_url":"https://github.com/joel-costigliola/assertj-core/pull/303.diff","patch_url":"https://github.com/joel-costigliola/assertj-core/pull/303.patch","issue_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/303","number":303,"state":"open","locked":false,"title":"Skeleton PathAssert, plus tests -- NOT FOR INCLUSION. Yet.","user":{"login":"fge","id":550006,"avatar_url":"https://avatars.githubusercontent.com/u/550006?v=3","gravatar_id":"","url":"https://api.github.com/users/fge","html_url":"https://github.com/fge","followers_url":"https://api.github.com/users/fge/followers","following_url":"https://api.github.com/users/fge/following{/other_user}","gists_url":"https://api.github.com/users/fge/gists{/gist_id}","starred_url":"https://api.github.com/users/fge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fge/subscriptions","organizations_url":"https://api.github.com/users/fge/orgs","repos_url":"https://api.github.com/users/fge/repos","events_url":"https://api.github.com/users/fge/events{/privacy}","received_events_url":"https://api.github.com/users/fge/received_events","type":"User","site_admin":false},"body":"Skeleton based on existing code. I modeled it on FileAssert. In fact I saw nothing related to anything java.nio.file in the code, so I created it from scratch...\r\n\r\nPreview only. I know the coding style does not fit; knowing that I use IDEA, do you happen to have a style file available?\r\n\r\nAlso, about error messages: there seem to be a lot of factories; FileAssert seems to basically use one per message! Is that on purpose? Can I create a single factory for Path-specific operations (including exists, non exists and absolute)?\r\n\r\nPlease comment! I'll add more test when the base is good enough for you.","created_at":"2014-12-22T06:09:22Z","updated_at":"2015-01-10T09:47:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43a0778d328c81ab9676542f603a8e49a0f5272e","assignee":null,"milestone":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones/10","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones/10/labels","id":782768,"number":10,"title":"2.0","description":null,"creator":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars.githubusercontent.com/u/382613?v=3","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":13,"state":"open","created_at":"2014-09-08T21:36:13Z","updated_at":"2015-01-08T21:04:23Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303/commits","review_comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303/comments","review_comment_url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/comments/{number}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/303/comments","statuses_url":"https://api.github.com/repos/joel-costigliola/assertj-core/statuses/91c1d2a968d10fbc6c2a5e2965cc6b0cc3568415","head":{"label":"fge:topic/jsr203","ref":"topic/jsr203","sha":"91c1d2a968d10fbc6c2a5e2965cc6b0cc3568415","user":{"login":"fge","id":550006,"avatar_url":"https://avatars.githubusercontent.com/u/550006?v=3","gravatar_id":"","url":"https://api.github.com/users/fge","html_url":"https://github.com/fge","followers_url":"https://api.github.com/users/fge/followers","following_url":"https://api.github.com/users/fge/following{/other_user}","gists_url":"https://api.github.com/users/fge/gists{/gist_id}","starred_url":"https://api.github.com/users/fge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fge/subscriptions","organizations_url":"https://api.github.com/users/fge/orgs","repos_url":"https://api.github.com/users/fge/repos","events_url":"https://api.github.com/users/fge/events{/privacy}","received_events_url":"https://api.github.com/users/fge/received_events","type":"User","site_admin":false},"repo":{"id":28326655,"name":"assertj-core","full_name":"fge/assertj-core","owner":{"login":"fge","id":550006,"avatar_url":"https://avatars.githubusercontent.com/u/550006?v=3","gravatar_id":"","url":"https://api.github.com/users/fge","html_url":"https://github.com/fge","followers_url":"https://api.github.com/users/fge/followers","following_url":"https://api.github.com/users/fge/following{/other_user}","gists_url":"https://api.github.com/users/fge/gists{/gist_id}","starred_url":"https://api.github.com/users/fge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fge/subscriptions","organizations_url":"https://api.github.com/users/fge/orgs","repos_url":"https://api.github.com/users/fge/repos","events_url":"https://api.github.com/users/fge/events{/privacy}","received_events_url":"https://api.github.com/users/fge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fge/assertj-core","description":"AssertJ is a library of assertions similar to fest-assert but providing a richer set of assertions.","fork":true,"url":"https://api.github.com/repos/fge/assertj-core","forks_url":"https://api.github.com/repos/fge/assertj-core/forks","keys_url":"https://api.github.com/repos/fge/assertj-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fge/assertj-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fge/assertj-core/teams","hooks_url":"https://api.github.com/repos/fge/assertj-core/hooks","issue_events_url":"https://api.github.com/repos/fge/assertj-core/issues/events{/number}","events_url":"https://api.github.com/repos/fge/assertj-core/events","assignees_url":"https://api.github.com/repos/fge/assertj-core/assignees{/user}","branches_url":"https://api.github.com/repos/fge/assertj-core/branches{/branch}","tags_url":"https://api.github.com/repos/fge/assertj-core/tags","blobs_url":"https://api.github.com/repos/fge/assertj-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fge/assertj-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fge/assertj-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/fge/assertj-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fge/assertj-core/statuses/{sha}","languages_url":"https://api.github.com/repos/fge/assertj-core/languages","stargazers_url":"https://api.github.com/repos/fge/assertj-core/stargazers","contributors_url":"https://api.github.com/repos/fge/assertj-core/contributors","subscribers_url":"https://api.github.com/repos/fge/assertj-core/subscribers","subscription_url":"https://api.github.com/repos/fge/assertj-core/subscription","commits_url":"https://api.github.com/repos/fge/assertj-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/fge/assertj-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/fge/assertj-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/fge/assertj-core/issues/comments/{number}","contents_url":"https://api.github.com/repos/fge/assertj-core/contents/{+path}","compare_url":"https://api.github.com/repos/fge/assertj-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fge/assertj-core/merges","archive_url":"https://api.github.com/repos/fge/assertj-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fge/assertj-core/downloads","issues_url":"https://api.github.com/repos/fge/assertj-core/issues{/number}","pulls_url":"https://api.github.com/repos/fge/assertj-core/pulls{/number}","milestones_url":"https://api.github.com/repos/fge/assertj-core/milestones{/number}","notifications_url":"https://api.github.com/repos/fge/assertj-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fge/assertj-core/labels{/name}","releases_url":"https://api.github.com/repos/fge/assertj-core/releases{/id}","created_at":"2014-12-22T06:04:50Z","updated_at":"2014-12-22T06:04:54Z","pushed_at":"2015-01-09T21:22:58Z","git_url":"git://github.com/fge/assertj-core.git","ssh_url":"git@github.com:fge/assertj-core.git","clone_url":"https://github.com/fge/assertj-core.git","svn_url":"https://github.com/fge/assertj-core","homepage":"","size":16088,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"joel-costigliola:master","ref":"master","sha":"09e3549af40eb15de0b2d7a9ce369490030d729f","user":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars.githubusercontent.com/u/382613?v=3","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"repo":{"id":8779606,"name":"assertj-core","full_name":"joel-costigliola/assertj-core","owner":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars.githubusercontent.com/u/382613?v=3","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joel-costigliola/assertj-core","description":"AssertJ is a library of assertions similar to fest-assert but providing a richer set of assertions.","fork":false,"url":"https://api.github.com/repos/joel-costigliola/assertj-core","forks_url":"https://api.github.com/repos/joel-costigliola/assertj-core/forks","keys_url":"https://api.github.com/repos/joel-costigliola/assertj-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joel-costigliola/assertj-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joel-costigliola/assertj-core/teams","hooks_url":"https://api.github.com/repos/joel-costigliola/assertj-core/hooks","issue_events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/events{/number}","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/events","assignees_url":"https://api.github.com/repos/joel-costigliola/assertj-core/assignees{/user}","branches_url":"https://api.github.com/repos/joel-costigliola/assertj-core/branches{/branch}","tags_url":"https://api.github.com/repos/joel-costigliola/assertj-core/tags","blobs_url":"https://api.github.com/repos/joel-costigliola/assertj-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joel-costigliola/assertj-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joel-costigliola/assertj-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/joel-costigliola/assertj-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joel-costigliola/assertj-core/statuses/{sha}","languages_url":"https://api.github.com/repos/joel-costigliola/assertj-core/languages","stargazers_url":"https://api.github.com/repos/joel-costigliola/assertj-core/stargazers","contributors_url":"https://api.github.com/repos/joel-costigliola/assertj-core/contributors","subscribers_url":"https://api.github.com/repos/joel-costigliola/assertj-core/subscribers","subscription_url":"https://api.github.com/repos/joel-costigliola/assertj-core/subscription","commits_url":"https://api.github.com/repos/joel-costigliola/assertj-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/joel-costigliola/assertj-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/comments/{number}","contents_url":"https://api.github.com/repos/joel-costigliola/assertj-core/contents/{+path}","compare_url":"https://api.github.com/repos/joel-costigliola/assertj-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joel-costigliola/assertj-core/merges","archive_url":"https://api.github.com/repos/joel-costigliola/assertj-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joel-costigliola/assertj-core/downloads","issues_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues{/number}","pulls_url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls{/number}","milestones_url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones{/number}","notifications_url":"https://api.github.com/repos/joel-costigliola/assertj-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/labels{/name}","releases_url":"https://api.github.com/repos/joel-costigliola/assertj-core/releases{/id}","created_at":"2013-03-14T16:18:49Z","updated_at":"2015-01-10T09:16:47Z","pushed_at":"2015-01-08T07:49:52Z","git_url":"git://github.com/joel-costigliola/assertj-core.git","ssh_url":"git@github.com:joel-costigliola/assertj-core.git","clone_url":"https://github.com/joel-costigliola/assertj-core.git","svn_url":"https://github.com/joel-costigliola/assertj-core","homepage":"","size":20301,"stargazers_count":331,"watchers_count":331,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":88,"mirror_url":null,"open_issues_count":43,"forks":88,"open_issues":43,"watchers":331,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303"},"html":{"href":"https://github.com/joel-costigliola/assertj-core/pull/303"},"issue":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/303"},"comments":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/joel-costigliola/assertj-core/statuses/91c1d2a968d10fbc6c2a5e2965cc6b0cc3568415"}}}}