java.lang.Object
one.jpro.platform.file.FileStorage
Utility class for file storage operations.
- Author:
- Besmir Beqiri
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PathcreateTempFile(@Nullable Path dir, @Nullable String fileName, @Nullable String fileType) Creates a temporary file in the specified directory with the provided file name and type.
-
Field Details
-
JPRO_TMP_DIR
The directory path to store temporary files. Defaults to a 'tmp' directory within a '.jpro' directory in the user's home directory.
-
-
Method Details
-
createTempFile
public static Path createTempFile(@Nullable @Nullable Path dir, @Nullable @Nullable String fileName, @Nullable @Nullable String fileType) throws IOException Creates a temporary file in the specified directory with the provided file name and type. If any of the parameters are null, it falls back to default values.- Parameters:
dir- the directory in which to create the file, if null, the directory defaults toJPRO_TMP_DIRfileName- the name of the file to create. Defaults to "filename" if nullfileType- the file extension or type. Defaults to ".tmp" if null- Returns:
- a Path object representing the created file
- Throws:
IOException- if an I/O error occurs or the file already exists
-