Created
December 7, 2021 08:38
-
-
Save CyberFlameGO/b62b9897ecbfcc3ba084559ace9a93d4 to your computer and use it in GitHub Desktop.
Returns the Temporary Items Folder on the Mac OS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import com.apple.mrj.MRJFileUtils; | |
public class MRJTempFolder | |
{ | |
/** | |
* Returns the Temporary Items Folder on the Mac OS. | |
* @return a File object representing the Temporary Items Folder, | |
* or null, if it could not be found. | |
*/ | |
public static File getTempFolder() | |
{ | |
File tempFolder = null; | |
try | |
{ | |
tempFolder = MRJFileUtils.findFolder(MRJFileUtils.kTemporaryFolderType); | |
} | |
catch (FileNotFoundException exc) { } | |
return tempFolder; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment