- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for isPathSafe (0.13 seconds)
-
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
Created: Fri Apr 03 20:58:12 GMT 2026 - Last Modified: Sat Nov 22 11:21:59 GMT 2025 - 10.3K bytes - Click Count (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) {Created: Fri Apr 03 20:58:12 GMT 2026 - Last Modified: Thu Feb 12 12:10:45 GMT 2026 - 13.2K bytes - Click Count (0)