-
Notifications
You must be signed in to change notification settings - Fork 3
TmpFolder
TmpFolder is a class designed to provide a singleton instance of a temporary folder utility. It allows obtaining the path to the default temporary directory for the current system.
The TmpFolder class provides a straightforward way to access the default temporary directory on the current system. It implements the Singleton pattern, ensuring that only one instance of the class can be created.
Static method that returns the singleton instance of TmpFolder. If no instance exists, a new one is created.
Gets the default temporary directory for the current system, returning the path as a string.
TmpFolder tmpFolder = TmpFolder.v(); // Obtains the singleton instanceTmpFolder tmpFolder = TmpFolder.v();
String tmpDirPath = tmpFolder.get(); // Gets the path to the default temporary directory
System.out.println("Temporary Directory Path: " + tmpDirPath);These examples illustrate how to utilize the TmpFolder class to access the default temporary directory for the current system. By implementing the Singleton pattern, it ensures consistent access to this resource across different parts of an application.