Skip to content

Commit f237c71

Browse files
committed
Note re getTempDirectoryPath trailing separator
1 parent 819cd6e commit f237c71

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ private static File getParentFile(final File file) {
14451445
/**
14461446
* Returns a {@link File} representing the system temporary directory.
14471447
*
1448-
* @return the system temporary directory.
1448+
* @return the system temporary directory as a File
14491449
* @since 2.0
14501450
*/
14511451
public static File getTempDirectory() {
@@ -1455,7 +1455,12 @@ public static File getTempDirectory() {
14551455
/**
14561456
* Returns the path to the system temporary directory.
14571457
*
1458-
* @return the path to the system temporary directory.
1458+
* @apiNote this method relies on the Java system property 'java.io.tmpdir'
1459+
* which may or may not have a trailing file separator.
1460+
* This can affect code that uses String processing to manipulate pathnames rather
1461+
* than the standard libary methods in classes such as {@link java.io.File}
1462+
*
1463+
* @return the path to the system temporary directory as a String
14591464
* @since 2.0
14601465
*/
14611466
public static String getTempDirectoryPath() {

0 commit comments

Comments
 (0)