Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for isPathSafe (0.21 sec)

  1. src/test/java/org/codelibs/core/io/FileUtilTest.java

            final File unsafeFile = new File(baseDir, "../../../etc/passwd");
    
            assertTrue("Safe file should be allowed", FileUtil.isPathSafe(safeFile, baseDir));
            assertFalse("Unsafe file should be blocked", FileUtil.isPathSafe(unsafeFile, baseDir));
        }
    
        /**
         * Test isPathSafe with path inside base directory
         *
         * @throws Exception
         */
        @Test
    Registered: Sat Dec 20 08:55:33 UTC 2025
    - Last Modified: Sat Nov 22 11:21:59 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/core/io/FileUtil.java

         * {@link #isPathSafe(Path, Path)}.
         * </p>
         *
         * @param fileToCheck the file to validate (must not be {@literal null})
         * @param baseDirectory the base directory that the file must be within (must not be {@literal null})
         * @return true if the file is safe (within the base directory), false otherwise
         */
        public static boolean isPathSafe(final File fileToCheck, final File baseDirectory) {
    Registered: Sat Dec 20 08:55:33 UTC 2025
    - Last Modified: Sat Nov 22 11:21:59 UTC 2025
    - 13.1K bytes
    - Viewed (0)
Back to top