- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for isPathSafe (0.05 sec)
-
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) -
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)