com.jogamp.common.util

## Class IOUtil

- java.lang.Object
- - com.jogamp.common.util.IOUtil

-     public class IOUtil
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `IOUtil.ClassResources` Helper compound associating a class instance and resource paths to be `resolved` at a later time.
    `static class` | `IOUtil.StreamMonitor`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEBUG`
    `static String` | `FILE_SCHEME` "file"
    `static String` | `HTTP_SCHEME` "http"
    `static String` | `HTTPS_SCHEME` "https"
    `static String` | `JAR_SCHEME` "jar"
    `static char` | `JAR_SCHEME_SEPARATOR` A JAR subprotocol is separeted from the JAR entry w/ this separator 33.
    `static String` | `SCHEME_SEPARATOR` ":"
    `static String` | `tmpSubDir` Subdirectory within platform's temporary root directory where all JogAmp related temp files are being stored: `jogamp`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `cleanPathString(String path)`
    `static void` | `close(Closeable stream, boolean throwRuntimeException)`
    `static URI` | `compose(String scheme, String schemeSpecificPart, String relativePath, String fragment)` Generates a URI for the relativePath relative to the schemeSpecificPart, hence the result is a absolute location.
    `static byte[]` | `copyStream2ByteArray(InputStream stream)` Copy the specified input stream to a byte array, which is being returned.
    `static ByteBuffer` | `copyStream2ByteBuffer(InputStream stream)` Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned.
    `static ByteBuffer` | `copyStream2ByteBuffer(InputStream stream, int initialCapacity)` Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned.
    `static int` | `copyStream2File(InputStream in, File outFile, int totalNumBytes)` Copy the specified input stream to the specified output file.
    `static int` | `copyStream2Stream(InputStream in, OutputStream out, int totalNumBytes)` Copy the specified input stream to the specified output stream.
    `static int` | `copyStream2Stream(int bufferSize, InputStream in, OutputStream out, int totalNumBytes)` Copy the specified input stream to the specified output stream.
    `static int` | `copyURLConn2File(URLConnection conn, File outFile)` Copy the specified URL resource to the specified output file.
    `static File` | `createTempFile(String prefix, String suffix, boolean executable)` Utilizing `File.createTempFile(String, String, File)` using `getTempDir(boolean)` as the directory parameter, ie.
    `static String` | `decodeFromURI(String encodedUri)` Deprecated. Use `decodeURIIfFilePath(URI)`
    `static String` | `decodeURIIfFilePath(URI uri)` If `uri` is a file scheme, implementation completes space-decoding [ "//"+`URI.getAuthority()` ] + `URI.getPath()`. Then it processes the `path` if `File.separatorChar` `== '\\'` as follows: slash -> backslash drop a starting single backslash, preserving windows UNC
    `static String` | `decodeURIToFilePath(String encodedUriPath)` Deprecated. Use `decodeURIIfFilePath(URI)`
    `static String` | `encodeFilePathToURI(String filePath)` Deprecated. Useless
    `static String` | `encodeToURI(String vanilla)` Deprecated. Useless
    `static String` | `getBasename(String fname)` Returns the basename of the given fname w/o directory part
    `static String` | `getClassFileName(String clazzBinName)`
    `static URL` | `getClassURL(String clazzBinName, ClassLoader cl)`
    `static String` | `getDirname(String fname)` Returns unified '/' dirname including the last '/'
    `static FileOutputStream` | `getFileOutputStream(File file, boolean allowOverwrite)`
    `static String` | `getFileSuffix(File file)` Returns the lowercase suffix of the given file name (the text after the last '.' in the file name).
    `static String` | `getFileSuffix(String filename)` Returns the lowercase suffix of the given file name (the text after the last '.' in the file name).
    `static String` | `getParentOf(String path)`
    `static String` | `getRelativeOf(File baseLocation, String relativeFile)` Generates a path for the 'relativeFile' relative to the 'baseLocation'.
    `static URI` | `getRelativeOf(URI baseURI, String relativePath)` Generates a URI for the relativePath relative to the baseURI, hence the result is a absolute location.
    `static URL` | `getRelativeOf(URL baseURL, String relativePath)` Wraps `getRelativeOf(URI, String)` for convenience.
    `static URLConnection` | `getResource(Class<?> context, String resourcePath)` Locating a resource using `getResource(String, ClassLoader)`: relative: `context`'s package name-path plus `resourcePath` via `context`'s ClassLoader.
    `static URLConnection` | `getResource(String resourcePath, ClassLoader cl)` Locating a resource using the ClassLoader's facilities.
    `static File` | `getTempDir(boolean executable)` Returns a platform independent writable directory for temporary files consisting of the platform's `temp-root` + `tmpSubDir`, e.g.
    `static String` | `getURIDirname(String uriS)` The URI's `protocol:/some/path/gluegen-rt.jar` parent dirname URI `protocol:/some/path/` will be returned.
    `static URI` | `getURIDirname(URI uri)` The URI's `protocol:/some/path/gluegen-rt.jar` parent dirname URI `protocol:/some/path/` will be returned.
    `static URLConnection` | `openURL(URL url)` Returns the connected URLConnection, or null if not url is not available
    `static URLConnection` | `openURL(URL url, String dbgmsg)` Returns the connected URLConnection, or null if not url is not available
    `static String` | `slashify(String path, boolean startWithSlash, boolean endWithSlash)`
    `static File` | `testDir(File dir, boolean create, boolean executable)` Returns the directory `dir`, which is processed and tested as described below.
    `static boolean` | `testDirExec(File dir)` Returns true if the given `dir` exists, and is a directory, and is writeable, and files can be executed from the directory
    `static boolean` | `testFile(File file, boolean shallBeDir, boolean shallBeWritable)` Test whether `file` exists and matches the given requirements
    `static URI` | `toURISimple(File file)` Using the simple conversion via File -> URI, assuming proper characters.
    `static URI` | `toURISimple(String protocol, String path, boolean isDirectory)` Using the simple conversion via File -> URI, assuming proper characters.
    `static URL` | `toURL(URI uri)` Deprecated. Useless

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEBUG

          public static final boolean DEBUG

    - #### SCHEME_SEPARATOR

          public static final String SCHEME_SEPARATOR

      ":"
      See Also:
        Constant Field Values

    - #### FILE_SCHEME

          public static final String FILE_SCHEME

      "file"
      See Also:
        Constant Field Values

    - #### HTTP_SCHEME

          public static final String HTTP_SCHEME

      "http"
      See Also:
        Constant Field Values

    - #### HTTPS_SCHEME

          public static final String HTTPS_SCHEME

      "https"
      See Also:
        Constant Field Values

    - #### JAR_SCHEME

          public static final String JAR_SCHEME

      "jar"
      See Also:
        Constant Field Values

    - #### JAR_SCHEME_SEPARATOR

          public static final char JAR_SCHEME_SEPARATOR

      A JAR subprotocol is separeted from the JAR entry w/ this separator 33. Even if no class is specified '!/' must follow!.
      See Also:
        Constant Field Values

    - #### tmpSubDir

          public static final String tmpSubDir

      Subdirectory within platform's temporary root directory where all JogAmp related temp files are being stored: `jogamp`
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### copyURLConn2File

          public static int copyURLConn2File(URLConnection conn,
                             File outFile)
                                      throws IOException

      Copy the specified URL resource to the specified output file. The total number of bytes written is returned. Both streams are closed upon completion.
      Parameters:
        `conn` - the open URLConnection
        `outFile` - the destination
      Returns:
      Throws:
        `IOException`

    - #### copyStream2File

          public static int copyStream2File(InputStream in,
                            File outFile,
                            int totalNumBytes)
                                     throws IOException

      Copy the specified input stream to the specified output file. The total number of bytes written is returned. Both streams are closed upon completion.
      Parameters:
        `in` - the source
        `outFile` - the destination
        `totalNumBytes` - informal number of expected bytes, maybe used for user feedback while processing. -1 if unknown
      Returns:
      Throws:
        `IOException`

    - #### copyStream2Stream

          public static int copyStream2Stream(InputStream in,
                              OutputStream out,
                              int totalNumBytes)
                                       throws IOException

      Copy the specified input stream to the specified output stream. The total number of bytes written is returned.
      Parameters:
        `in` - the source
        `out` - the destination
        `totalNumBytes` - informal number of expected bytes, maybe used for user feedback while processing. -1 if unknown
      Returns:
      Throws:
        `IOException`

    - #### copyStream2Stream

          public static int copyStream2Stream(int bufferSize,
                              InputStream in,
                              OutputStream out,
                              int totalNumBytes)
                                       throws IOException

      Copy the specified input stream to the specified output stream. The total number of bytes written is returned.
      Parameters:
        `bufferSize` - the intermediate buffer size, should be `MachineDescription.pageSizeInBytes()` for best performance.
        `in` - the source
        `out` - the destination
        `totalNumBytes` - informal number of expected bytes, maybe used for user feedback while processing. -1 if unknown
      Returns:
      Throws:
        `IOException`

    - #### copyStream2ByteArray

          public static byte[] copyStream2ByteArray(InputStream stream)
                                             throws IOException

      Copy the specified input stream to a byte array, which is being returned.
      Throws:
        `IOException`

    - #### copyStream2ByteBuffer

          public static ByteBuffer copyStream2ByteBuffer(InputStream stream)
                                                  throws IOException

      Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned.

      The implementation creates the ByteBuffer w/ `copyStream2ByteArray(InputStream)`'s returned byte array.

      Parameters:
        `stream` - input stream, which will be wrapped into a BufferedInputStream, if not already done.
      Throws:
        `IOException`

    - #### copyStream2ByteBuffer

          public static ByteBuffer copyStream2ByteBuffer(InputStream stream,
                                         int initialCapacity)
                                                  throws IOException

      Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned.

      The implementation creates the ByteBuffer w/ `copyStream2ByteArray(InputStream)`'s returned byte array.

      Parameters:
        `stream` - input stream, which will be wrapped into a BufferedInputStream, if not already done.
        `initialCapacity` - initial buffer capacity in bytes, if > available bytes
      Throws:
        `IOException`

    - #### slashify

          public static String slashify(String path,
                        boolean startWithSlash,
                        boolean endWithSlash)
                                 throws URISyntaxException

      Parameters:
        `path` -
        `startWithSlash` -
        `endWithSlash` -
      Returns:
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`

    - #### toURISimple

          public static URI toURISimple(File file)
                                 throws URISyntaxException

      Using the simple conversion via File -> URI, assuming proper characters.
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`
        `URISyntaxException` - if the resulting string does not comply w/ an RFC 2396 URI

    - #### toURISimple

          public static URI toURISimple(String protocol,
                        String path,
                        boolean isDirectory)
                                 throws URISyntaxException

      Using the simple conversion via File -> URI, assuming proper characters.
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`
        `URISyntaxException` - if the resulting string does not comply w/ an RFC 2396 URI

    - #### getFileSuffix

          public static String getFileSuffix(File file)

      Returns the lowercase suffix of the given file name (the text after the last '.' in the file name). Returns null if the file name has no suffix. Only operates on the given file name; performs no I/O operations.
      Parameters:
        `file` - name of the file
      Returns:
        lowercase suffix of the file name
      Throws:
        `NullPointerException` - if file is null

    - #### getFileSuffix

          public static String getFileSuffix(String filename)

      Returns the lowercase suffix of the given file name (the text after the last '.' in the file name). Returns null if the file name has no suffix. Only operates on the given file name; performs no I/O operations.
      Parameters:
        `filename` - name of the file
      Returns:
        lowercase suffix of the file name
      Throws:
        `NullPointerException` - if filename is null

    - #### getFileOutputStream

          public static FileOutputStream getFileOutputStream(File file,
                                             boolean allowOverwrite)
                                                      throws IOException

      Parameters:
        `file` -
        `allowOverwrite` -
      Returns:
        outputStream The resulting output stream
      Throws:
        `IOException` - if the file already exists and `allowOverwrite` is false, the class `FileOutputStream` is not accessible or the user does not have sufficient rights to access the local filesystem.

    - #### getClassFileName

          public static String getClassFileName(String clazzBinName)

    - #### getClassURL

          public static URL getClassURL(String clazzBinName,
                        ClassLoader cl)
                                 throws IOException

      Parameters:
        `clazzBinName` - com.jogamp.common.util.cache.TempJarCache
        `cl` - ClassLoader to locate the JarFile
      Returns:
        jar:file:/usr/local/projects/JOGL/gluegen/build-x86_64/gluegen-rt.jar!/com/jogamp/common/util/cache/TempJarCache.class
      Throws:
        `IOException` - if the jar file could not been found by the ClassLoader

    - #### getBasename

          public static String getBasename(String fname)
                                    throws URISyntaxException

      Returns the basename of the given fname w/o directory part
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`

    - #### getDirname

          public static String getDirname(String fname)
                                   throws URISyntaxException

      Returns unified '/' dirname including the last '/'
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`

    - #### getURIDirname

          public static URI getURIDirname(URI uri)
                                   throws IllegalArgumentException,
                                          URISyntaxException

      The URI's `protocol:/some/path/gluegen-rt.jar` parent dirname URI `protocol:/some/path/` will be returned.

      protocol may be "file", "http", etc..

      Parameters:
        `uri` - "protocol:/some/path/gluegen-rt.jar"
      Returns:
        "protocol:/some/path/"
      Throws:
        `IllegalArgumentException` - if the URI doesn't match the expected formatting, or is null
        `URISyntaxException`

    - #### getURIDirname

          public static String getURIDirname(String uriS)
                                      throws IllegalArgumentException,
                                             URISyntaxException

      The URI's `protocol:/some/path/gluegen-rt.jar` parent dirname URI `protocol:/some/path/` will be returned.

      protocol may be "file", "http", etc..

      Parameters:
        `uri` - "protocol:/some/path/gluegen-rt.jar" (URI encoded)
      Returns:
        "protocol:/some/path/"
      Throws:
        `IllegalArgumentException` - if the URI doesn't match the expected formatting, or is null
        `URISyntaxException`

    - #### toURL

          public static URL toURL(URI uri)
                           throws IOException,
                                  IllegalArgumentException,
                                  URISyntaxException

      Deprecated. Useless
      Simply returns `URI.toURL()`.
      Parameters:
        `uri` -
      Returns:
      Throws:
        `IOException`
        `IllegalArgumentException`
        `URISyntaxException`

    - #### getResource

          public static URLConnection getResource(Class<?> context,
                                  String resourcePath)

      Locating a resource using `getResource(String, ClassLoader)`:
      - relative: `context`'s package name-path plus `resourcePath` via `context`'s ClassLoader. This allows locations relative to JAR- and other URLs. The `resourcePath` may start with `../` to navigate to parent folder.
      - absolute: `context`'s ClassLoader and the `resourcePath` as is (filesystem)

      Returns the resolved and open URLConnection or null if not found.

      See Also:
        `getResource(String, ClassLoader)`, `ClassLoader.getResource(String)`, `ClassLoader.getSystemResource(String)`

    - #### getResource

          public static URLConnection getResource(String resourcePath,
                                  ClassLoader cl)

      Locating a resource using the ClassLoader's facilities.

      Returns the resolved and connected URLConnection or null if not found.

      See Also:
        `ClassLoader.getResource(String)`, `ClassLoader.getSystemResource(String)`, `URL.URL(String)`, `File.File(String)`

    - #### getRelativeOf

          public static String getRelativeOf(File baseLocation,
                             String relativeFile)
                                      throws URISyntaxException

      Generates a path for the 'relativeFile' relative to the 'baseLocation'.
      Parameters:
        `baseLocation` - denotes a directory
        `relativeFile` - denotes a relative file to the baseLocation
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`

    - #### getParentOf

          public static String getParentOf(String path)
                                    throws URISyntaxException

      Parameters:
        `path` - assuming a slashified path beginning with "/" as it's root directory, either denotes a file or directory.
      Returns:
        parent of path
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available

    - #### cleanPathString

          public static String cleanPathString(String path)
                                        throws URISyntaxException

      Parameters:
        `path` - assuming a slashified path beginning with "/" as it's root directory, either denotes a file or directory.
      Returns:
        clean path string where `../` and `./` is resolved.
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`

    - #### getRelativeOf

          public static URI getRelativeOf(URI baseURI,
                          String relativePath)
                                   throws URISyntaxException

      Generates a URI for the relativePath relative to the baseURI, hence the result is a absolute location.

      Impl. operates on the scheme-specific-part, and hence is sub-protocol savvy.

      In case baseURI is not a path ending w/ '/', it's a assumed to be a file and it's parent is being used.

      Parameters:
        `baseURI` - denotes a URI to a directory ending w/ '/', or a file. In the latter case the file's directory is being used.
        `relativePath` - denotes a relative file to the baseLocation's parent directory (URI encoded)
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`

    - #### getRelativeOf

          public static URL getRelativeOf(URL baseURL,
                          String relativePath)
                                   throws IOException

      Wraps `getRelativeOf(URI, String)` for convenience.
      Parameters:
        `relativePath` - denotes a relative file to the baseLocation's parent directory (URI encoded)
      Throws:
        `IOException`

    - #### compose

          public static URI compose(String scheme,
                    String schemeSpecificPart,
                    String relativePath,
                    String fragment)
                             throws URISyntaxException

      Generates a URI for the relativePath relative to the schemeSpecificPart, hence the result is a absolute location.

      schemeSpecificPart's query, if exist is split to path and query.

      In case path is not a path ending w/ '/', it's a assumed to be a file and it's parent is being used.

      Parameters:
        `scheme` - scheme of the resulting URI
        `schemeSpecificPart` - may include a query, which is separated while processing (URI encoded)
        `relativePath` - denotes a relative file to the baseLocation's parent directory (URI encoded)
        `fragment` - the URI fragment (URI encoded)
      Throws:
        `URISyntaxException` - if path is empty or has no parent directory available while resolving `../`
      See Also:
        `encodeToURI(String)`

    - #### encodeToURI

          public static String encodeToURI(String vanilla)

      Deprecated. Useless
      Escapes characters not complying w/ RFC 2396 and the `URI.URI(String)` ctor.
      - SPACE -> %20

    - #### decodeFromURI

          public static String decodeFromURI(String encodedUri)

      Deprecated. Use `decodeURIIfFilePath(URI)`
      Reverses escaping of characters as performed via `encodeToURI(String)`.
      - %20 -> SPACE

    - #### encodeFilePathToURI

          public static String encodeFilePathToURI(String filePath)

      Deprecated. Useless
      Encodes file path characters not complying w/ RFC 2396 and the `URI.URI(String)` ctor.

      Implementation processes the `filePath` if `File.separatorChar` `== '\\'` as follows:

      - backslash -> slash
      - ensure starting with slash

      Note that this method does not perform space encoding, which can be utilized via `encodeToURI(String)`.

      Even though Oracle's JarURLStreamHandler can handle backslashes and erroneous URIs w/ e.g. Windows file 'syntax', other may not (Netbeans).
      See Bug 857 - http://jogamp.org/bugzilla/show_bug.cgi?id=857

      See Also:
        `encodeToURI(String)`

    - #### decodeURIToFilePath

          public static String decodeURIToFilePath(String encodedUriPath)

      Deprecated. Use `decodeURIIfFilePath(URI)`
      Completes decoding uri-file path characters complying w/ RFC 2396 to native file-path.

      Implementation decodes the space-encoding `path=`decodeFromURI`(uriPath)`.

      Then it processes the `path` if `File.separatorChar` `== '\\'` as follows:

      - slash -> backslash
      - drop a starting single backslash, preserving windows UNC
      Parameters:
        `encodedUriPath` - URI encoded path
      See Also:
        `decodeFromURI(String)`

    - #### decodeURIIfFilePath

          public static String decodeURIIfFilePath(URI uri)

      If `uri` is a file scheme, implementation completes space-decoding [ "//"+`URI.getAuthority()` ] + `URI.getPath()`.
      Then it processes the `path` if `File.separatorChar` `== '\\'` as follows:
      - slash -> backslash
      - drop a starting single backslash, preserving windows UNC

      Otherwise it returns the `URI.toASCIIString()` encoded URI.

      See Also:
        `decodeFromURI(String)`, `decodeURIToFilePath(String)`

    - #### openURL

          public static URLConnection openURL(URL url)

      Returns the connected URLConnection, or null if not url is not available

    - #### openURL

          public static URLConnection openURL(URL url,
                              String dbgmsg)

      Returns the connected URLConnection, or null if not url is not available

    - #### testFile

          public static boolean testFile(File file,
                         boolean shallBeDir,
                         boolean shallBeWritable)

      Test whether `file` exists and matches the given requirements
      Parameters:
        `file` -
        `shallBeDir` -
        `shallBeWritable` -
      Returns:

    - #### testDirExec

          public static boolean testDirExec(File dir)
                                     throws SecurityException

      Returns true if the given `dir`
      1. exists, and
      2. is a directory, and
      3. is writeable, and
      4. files can be executed from the directory
      Parameters:
        `dir` -
      Throws:
        `SecurityException` - if file creation and process execution is not allowed within the current security context

    - #### testDir

          public static File testDir(File dir,
                     boolean create,
                     boolean executable)
                              throws SecurityException

      Returns the directory `dir`, which is processed and tested as described below.
      1. If `create` is `true` and the directory does not exist yet, it is created incl. all sub-directories.
      2. If `dirName` exists, but is not a directory, `null` is being returned.
      3. If the directory does not exist or is not writeable, `null` is being returned.
      4. If `executable` is `true` and files cannot be executed from the directory, `null` is being returned.
      Parameters:
        `dir` - the directory to process
        `create` - true if the directory shall be created if not existing
        `executable` - true if the user intents to launch executables from the temporary directory, otherwise false.
      Throws:
        `SecurityException` - if file creation and process execution is not allowed within the current security context

    - #### getTempDir

          public static File getTempDir(boolean executable)
                                 throws SecurityException,
                                        RuntimeException

      Returns a platform independent writable directory for temporary files consisting of the platform's `temp-root` + `tmpSubDir`, e.g. `/tmp/jogamp_0000/`.

      On standard Java the `temp-root` folder is specified by `java.io.tempdir`.

      On Android the `temp-root` folder is relative to the applications local folder (see `Context#getDir(String, int)`) is returned, if the Android application/activity has registered it's Application Context via `StaticContext.init(..)`. This allows using the temp folder w/o the need for `sdcard` access, which would be the `java.io.tempdir` location on Android!

      In case `temp-root` is the users home folder, a dot is being prepended to `tmpSubDir`, i.e.: `/home/user/.jogamp_0000/`.

      Parameters:
        `executable` - true if the user intents to launch executables from the temporary directory, otherwise false.
      Throws:
        `RuntimeException` - if no temporary directory could be determined
        `SecurityException` - if access to `java.io.tmpdir` is not allowed within the current security context
      See Also:
        `PropertyAccess.getProperty(String, boolean)`, `Context#getDir(String, int)`

    - #### createTempFile

          public static File createTempFile(String prefix,
                            String suffix,
                            boolean executable)
                                     throws IllegalArgumentException,
                                            IOException,
                                            SecurityException

      Utilizing `File.createTempFile(String, String, File)` using `getTempDir(boolean)` as the directory parameter, ie. location of the root temp folder.
      Parameters:
        `prefix` -
        `suffix` -
        `executable` - true if the temporary root folder needs to hold executable files, otherwise false.
      Returns:
      Throws:
        `IllegalArgumentException`
        `IOException`
        `SecurityException`
      See Also:
        `File.createTempFile(String, String)`, `File.createTempFile(String, String, File)`, `getTempDir(boolean)`

    - #### close

          public static void close(Closeable stream,
                   boolean throwRuntimeException)
                            throws RuntimeException

      Throws:
        `RuntimeException`