Skip to content

Instantly share code, notes, and snippets.

@CyberFlameGO
Created December 7, 2021 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberFlameGO/b62b9897ecbfcc3ba084559ace9a93d4 to your computer and use it in GitHub Desktop.
Save CyberFlameGO/b62b9897ecbfcc3ba084559ace9a93d4 to your computer and use it in GitHub Desktop.
Returns the Temporary Items Folder on the Mac OS.
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