public class FileIO
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(java.lang.String srcPath,
java.lang.String dstPath)
Copy any file.
|
static javax.swing.filechooser.FileFilter |
getCurrentFilter() |
static java.lang.String |
getExtension(java.lang.String filename)
Get the file extension, including the dot.
|
static boolean |
isXmlFile(java.lang.String filePath)
Reads the first 5 characters of the given file to see whether they are
>?xml
New 9.12.3 |
static java.lang.String |
removeExtension(java.lang.String filename)
Remove the file extension, including the dot.
|
static java.lang.String |
selectDirectory(java.lang.String title,
java.lang.String startingDir)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectInputFile(java.lang.String title)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectInputFile(java.lang.String title,
java.lang.String folderName)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectInputFile(java.lang.String title,
java.lang.String folderName,
javax.swing.filechooser.FileFilter[] filters)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectInputFile(java.lang.String title,
java.lang.String folderName,
javax.swing.filechooser.FileFilter[] filters,
java.lang.String initialFileName)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectInputFile(java.lang.String title,
java.lang.String folderName,
javax.swing.filechooser.FileFilter[] filters,
java.lang.String initialFileName,
boolean folderRatherThanFile)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.io.File[] |
selectInputFiles(java.lang.String title)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.io.File[] |
selectInputFiles(java.lang.String title,
java.lang.String folderName)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.io.File[] |
selectInputFiles(java.lang.String title,
java.lang.String folderName,
javax.swing.filechooser.FileFilter[] filters)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectOutputFile(java.lang.String title)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectOutputFile(java.lang.String title,
java.lang.String folderName)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectOutputFile(java.lang.String title,
java.lang.String folderName,
javax.swing.filechooser.FileFilter[] filters)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
static java.lang.String |
selectOutputFile(java.lang.String title,
java.lang.String folderName,
javax.swing.filechooser.FileFilter[] filters,
java.lang.String initialFileName)
Returns null if user leaves the file selection dialogue by the
cancel button.
|
public static void copyFile(java.lang.String srcPath, java.lang.String dstPath) throws java.io.IOException
java.io.IOException
public static java.lang.String getExtension(java.lang.String filename)
public static boolean isXmlFile(java.lang.String filePath)
public static java.lang.String removeExtension(java.lang.String filename)
public static java.lang.String selectDirectory(java.lang.String title, java.lang.String startingDir)
public static java.lang.String selectInputFile(java.lang.String title)
public static java.lang.String selectInputFile(java.lang.String title, java.lang.String folderName)
public static java.lang.String selectInputFile(java.lang.String title, java.lang.String folderName, javax.swing.filechooser.FileFilter[] filters)
public static java.lang.String selectInputFile(java.lang.String title, java.lang.String folderName, javax.swing.filechooser.FileFilter[] filters, java.lang.String initialFileName)
public static java.lang.String selectInputFile(java.lang.String title, java.lang.String folderName, javax.swing.filechooser.FileFilter[] filters, java.lang.String initialFileName, boolean folderRatherThanFile)
public static java.io.File[] selectInputFiles(java.lang.String title)
public static java.io.File[] selectInputFiles(java.lang.String title, java.lang.String folderName)
public static java.io.File[] selectInputFiles(java.lang.String title, java.lang.String folderName, javax.swing.filechooser.FileFilter[] filters)
public static java.lang.String selectOutputFile(java.lang.String title)
public static java.lang.String selectOutputFile(java.lang.String title, java.lang.String folderName)
public static java.lang.String selectOutputFile(java.lang.String title, java.lang.String folderName, javax.swing.filechooser.FileFilter[] filters)
public static java.lang.String selectOutputFile(java.lang.String title, java.lang.String folderName, javax.swing.filechooser.FileFilter[] filters, java.lang.String initialFileName)
public static javax.swing.filechooser.FileFilter getCurrentFilter()