org.apache.jmeter.gui.util

## Class FileDialoger

- java.lang.Object
- - org.apache.jmeter.gui.util.FileDialoger

-     public final class FileDialoger
      extends java.lang.Object

  Class implementing a file open dialogue

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getLastJFCDirectory()`
    `static javax.swing.JFileChooser` | `promptToOpenFile()` Prompts the user to choose a file or a directory from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToOpenFile(java.lang.String existingFileName)` Prompts the user to choose a file or a directory from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToOpenFile(java.lang.String[] exts)` Prompts the user to choose a file or a directory from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToOpenFile(java.lang.String[] exts, java.lang.String existingFileName)` Prompts the user to choose a file or a directory from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToOpenFile(java.lang.String[] exts, java.lang.String existingFileName, boolean onlyDirectories)` Prompts the user to choose a file or a directory from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToOpenFile(java.lang.String existingFileName, boolean onlyDirectories)` Prompts the user to choose a file or a directory from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToSaveFile(java.lang.String filename)` Prompts the user to choose a file from their filesystems for our own devious uses.
    `static javax.swing.JFileChooser` | `promptToSaveFile(java.lang.String filename, java.lang.String[] extensions)` Get a JFileChooser with a new FileFilter.
    `static void` | `setLastJFCDirectory(java.lang.String lastJFCDirectory)`

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

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

- - ### Method Detail

    - #### promptToOpenFile

          public static javax.swing.JFileChooser promptToOpenFile()

      Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen

    - #### promptToOpenFile

          public static javax.swing.JFileChooser promptToOpenFile(java.lang.String existingFileName)

      Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Parameters:
        `existingFileName` - The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen

    - #### promptToOpenFile

          public static javax.swing.JFileChooser promptToOpenFile(java.lang.String existingFileName,
                                                                  boolean onlyDirectories)

      Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Parameters:
        `existingFileName` - The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.
        `onlyDirectories` - If true, only directories are displayed in the FileChooser
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen

    - #### promptToOpenFile

          public static javax.swing.JFileChooser promptToOpenFile(java.lang.String[] exts)

      Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Parameters:
        `exts` - The list of allowed file extensions. If empty, any file extension is allowed
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen

    - #### promptToOpenFile

          public static javax.swing.JFileChooser promptToOpenFile(java.lang.String[] exts,
                                                                  java.lang.String existingFileName)

      Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Parameters:
        `exts` - The list of allowed file extensions. If empty, any file extension is allowed
        `existingFileName` - The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen

    - #### promptToOpenFile

          public static javax.swing.JFileChooser promptToOpenFile(java.lang.String[] exts,
                                                                  java.lang.String existingFileName,
                                                                  boolean onlyDirectories)

      Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Parameters:
        `exts` - The list of allowed file extensions. If empty, any file extension is allowed
        `existingFileName` - The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.
        `onlyDirectories` - If true, only directories are displayed in the FileChooser
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen

    - #### promptToSaveFile

          public static javax.swing.JFileChooser promptToSaveFile(java.lang.String filename)

      Prompts the user to choose a file from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.
      Parameters:
        `filename` - The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.
      Returns:
        the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
      See Also:
        `promptToOpenFile()`

    - #### promptToSaveFile

          public static javax.swing.JFileChooser promptToSaveFile(java.lang.String filename,
                                                                  java.lang.String[] extensions)

      Get a JFileChooser with a new FileFilter.
      Parameters:
        `filename` - file name
        `extensions` - list of extensions
      Returns:
        the FileChooser - null if no file was chosen

    - #### getLastJFCDirectory

          public static java.lang.String getLastJFCDirectory()

      Returns:
        The last directory visited by the user while choosing Files

    - #### setLastJFCDirectory

          public static void setLastJFCDirectory(java.lang.String lastJFCDirectory)

      Parameters:
        `lastJFCDirectory` - The last directory visited by the user while choosing Files

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.